RotateShape
RotateShape ShapeIndex, Angle#, Scaler#
 
Parameters:

    ShapeIndex = The Index of the shape you wish to rotate
    Angle# = The angle to rotate this shape
    Scaler# = The amount to scale this shape by
Returns: NONE
 

     RotateShape dynamically rotates and scales a shapes vertex. Shapes actually have two copies of the vertex buffers inside them, the 'original' and a 'rotated' version. So rotating the shape doesn't permanently change the shapes original vertex, rather the transformed originals vertex are stored in the rotated buffer for display and collision.



FACTS:


     * When a shape is rotated, the rotation doesn't damage the shapes original vertex.




Mini Tutorial:


      This example creates a convex shape, then rotates and draws it.


  
  
; Create a Convex MySHape, of size 50, with 6 edges
  MySHape =NewConvexShape(50,6)
  
  
; Start of Do/loop
  Do
     
   ; Clear the Screen
     Cls RGB(0,0,0)
     
   ; Rotate MyShape
     RotateShape MyShape,Angle#,1+Cos(angle#)
     
   ; Draw the Filled shape
     CenterText 100,20,"Rotating Shape"
     DrawShape MyShape,100,100,2
     
   ; Calc the X & Y  Scale
     scalex#=1+Cos(angle#)
     Scaley#=2+Sin(angle#)
     
   ; Rotate MyShape
     RotateShapeXY MyShape,Angle#,ScaleX#,Scaley#
     
     
   ; Draw the Filled shape
     CenterText 300,20,"Rotating Shape"
     DrawShape MyShape,300,100,2
     
     
   ; Bump and wrap the rotation angle
     Angle#=WrapAngle(angle#,1)
     
   ; Display the screen and wait for a key press
     Sync
  Loop
  



      This example outputs,





 
Related Info: DrawShape | RefreshShape | RotateShapeXY | ScaleShape | ScaleShapeXY | ShiftShape :
 


(c) Copyright 2002 - 2024 - Kevin Picone - PlayBASIC.com