|
a2DrawImage
This command will draw an image on the screen, similar to DBPro's native PASTE IMAGE or SPRITE commands.
a2DrawImage imageId, x, y, angle, centerX, centerY, scale, options, color
imageId
Integer
The number you assigned to the image when you grabbed/loaded it.
x
Float
This value specifies the X location of where the image is drawn, offset by the value of the centerX parameter.
y
Float
This value specifies the y location of where the image is drawn, offset by the value of the centerY parameter.
angle
Float
This value specifies the angle at which the image is drawn. The image is rotated around its local x and y origin, which defaults to the upper left corner of the image. The local origin is offset by the centerX and centerY parameters.
centerX
Float
This value specifies the local x origin of the image.
centerY
Float
This value specifies the local y origin of the image.
scale
Float
This value specifies the scale of the drawn image. A value of 1.0 means no scaling, 0.5 would yield a half-sized image, and 2.0 would give an image two times larger than the original.
options
Integer
This value specifies whether an image is flipped or mirrored when drawn. Use a2Option_FlipX() to flip the image horizontally, and a2Option_FlipY() to flip it vertically.
color
Integer
This value is a 32 bit integer that is used to tint the image a specific color. Use 0xFFFFFFFF (pure white) to draw the image with no tinting.
This command does not return a value.
This command will draw an image on the screen, similar to DBPro's native PASTE IMAGE or SPRITE commands.
ink 0xFFFFFFFF,0
box 1,1,63,63
ink 0xFFFF0000
box 2,2,62,62
imageID = 1
get image imageID,0,0,64,64,3
do
for x = 0 to 10
cls
a2DrawImage imageID, screen width()/2, screen height()/2, x*15, 32, 32, 1.0-(x/10.0), 0, 0xFFFFFFFF
wait 60
next x
for x = 9 to 1 step -1
cls
a2DrawImage imageID, screen width()/2, screen height()/2, 360-x*15, 32, 32, 1.0-(x/10.0), 0, 0xFFFFFFFF
wait 60
next x
loop
a2Option_FlipX
a2Option_FlipY
Advanced 2D Index
Main Menu
|