Main Menu

Sprite Handles & Rotation

Started by kevin, January 10, 2005, 12:17:50 AM

Previous topic - Next topic

kevin


PlayBASIC Code: [Select]
; Clear Screen to a bluey colour
Cls $223388

; Grab a bit of screen as an image
GetImage 5,0,0,100,50

; convert the image to the FX image
PrepareFXImage 5

; Create sprite #1
CreateSprite 1

; Ste sprite #1 to use Image #5
SpriteImage 1,5

; Re-Position the sprite at Xpos - 50, Ypos,-25
SpriteHandle 1,-50,-25

; Or you could just use Center Sprite Handle
; CenterSpriteHandle 1


; Set this sprites drawmode to rotation
SpriteDrawMode 1,2

; Position Sporite #1 at 100x,200y
PositionSprite 1,100,100


; Start a Do=Loop
Do
; Clear Screen
Cls 0

; Turn the sprite To the LEft
TurnSprite 1,1

; Draw this sprite
DrawSprite 1

; Show Sprites Rotation Axis
DotC 100,100,$ffffff

Sync
Loop






tomazmb

Hello Kevin,

Sorry for posting so much, but I do admire your way of commenting things, it make so much easier for me to follow. Thanks.

Have a nice day,

Tomaz
My computer specification:

AMD Athlon 64 2800+
MB ASUS K8V Socket 754 VIA K8T800
SB Audigy 2
3 GB RAM DDR 400 MHz PQI
AGP NVIDIA GeForce 7600GT 256 MB-Club 3D
Windows XP Pro SP2
DirectX 9.0c