ScaleShapeXY
ScaleShapeXY ShapeIndex, ScalerX#, ScalerY#
 
Parameters:

    ShapeIndex = The Index of the shape you wish to rotate
    ScalerX# = The amount to scale this shapes X axis by
    ScalerY# = The amount to scale this shapesYX axis by
Returns: NONE
 

     ScaleShapeXY permanently scales a shapes vertex. The command simply runs through all the shapes vertex and multiplies the X coordinates with ScalerX# and Y coordinates with ScalerY# values you provide. This is not to be confusing with the dynamic scaling that can be applied during rotation (See RotateShape), where such scaling only affects the rotated vertex and not the original vertex.



FACTS:


      * ScaleShape changes the original vertex of the shape.



Mini Tutorial:


      This example creates a convex shape, then draws it, will allowing the use the scale the shape, in or out.



  
; Limit the program to 60 frames per second or slower
  SetFPS 60
  
; Create a convex shape, 100 units in size, with 5
; edges
  CreateConvexShape 1,100,5
  
; start a do/loop
  Do
   ; clear the screen
     Cls RGB(0,0,0)
     
   ; display instrutions
     Print "Left Mouse to Scale IN"
     Print "Right Mouse to Scale Out"
     
   ; Draw the shape in the middle of the screen
     DrawShape 1,GetScreenWidth()/2,GetScreenHeight()/2,2
     
   ; if the Left mouse  button is pressed then scale the
   ; shape bigger
     If LeftMouseButton() Then ScaleShape 1,1.10
   ; if the right mouse button is pressed then scale the
   ; shape smaller
     If RightMouseButton() Then ScaleShape 1,0.90
     
   ; dispaly the screen
     Sync
   ; loop back to the DO statement
  Loop
  



This example would output.

  
  no Text output
  

 
Related Info: DrawShape | RotateShape | RotateShapeXY | ScaleShape :
 


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