TGC Codebase Backup



Function_Rotate_Image by Mark Garrett

28th Jan 2007 21:19
Summary

Rotates your image on the screen



Description



Code
                                    ` This code was downloaded from The Game Creators
                                    ` It is reproduced here with full permission
                                    ` http://www.thegamecreators.com
                                    
                                    REM Project: Rotate_Image_
REM Created: 28.1.2007 18:47:22
` By Mark Garrett   bubbb@verizon.net


`make image:
ink rgb(0,255,255),0
set cursor 50,75: print "Hello World!"


` get the image:
GET IMAGE 99,  50, 75, 150,  95,1


`stretch image and spin it:_
for angle = 1 to 360 step 3

`                 (ImageNumber, Xpos, Ypos, Angle#,ScaleX, ScaleY,HandleX, HandleY, Backsave, Transparency)
Draw_Rotated_Image(    99,       350,  250, angle,  350,    550,    50,       10,      1,           0     )

 wait  1


next angle
text 200,10, "To exit press the left mouse button"
wait mouse
   if mouseclick() = 2
   get image 1,0,0,640,480,1: save image "Rotate_Image.jpg",1 :wait 5000
   endif
end





`&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&n  function  &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
Function Draw_Rotated_Image(ImageNumber, Xpos, Ypos, Angle#,ScaleX, ScaleY,HandleX, HandleY, Backsave, Transparency)

     Sprite 300000, Xpos, Ypos, ImageNumber  ` initiate sprite
     HIDE SPRITE 300000
     SET SPRITE 300000, Backsave, Transparency
     OFFSET SPRITE 300000, HandleX, HandleY
     stretch SPRITE  300000, ScaleX, ScaleY
   
rotate sprite 300000, Angle#
paste Sprite 300000, Xpos, Ypos




endfunction
`&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
`Parameters:

`    ImageNumber = The identifier of this image
`    Xpos = The X coord to draw the image at
`    Ypos = The Y coord to draw the image at
`    Angle# = The angle of the rotated image
`    ScaleX = A scaler that is applied to the width
`    ScaleY = A scaler that is applied to the height
 `   HandleX = X offset for rotations axis point
`    HandleY = Y offset for rotations axis point
`    Backsave flag = Will the image erase itself each time it moves?  (1= yes,  0 = no)
`    TransparentFlag = Render the image with or without transparency (0=solid, 1=transparent)