Azioni – Draw

Drawing image image image image image image image image image image image
Settings image image image
Other image image

Normally in each step of the game, for each instance, its sprite is drawn in the room.
You can change this by putting actions in the draw event.
Note that these are only executed when the instance is visible!

The following drawing actions are available.
These actions only make sense in the drawing event.
At other places they are basically ignored.

image Draw Sprite

You specify the sprite, the position (either absolute or relative to the current instance position) and the subimage of the sprite. (The subimages are numbered from 0 upwards.) If you want to draw the current subimage, use number -1.

image Draw Background

You indicate the background image, the position (absolute or relative) and whether the image should be tiled all over the room or not.

image Draw Text

You specify the text and the position. A # symbol in the text is interpreted as going to a new line. (Use \# to get the # symbol itself.) So you can create multi-line texts. If the text starts with a quote or a double quote, it is interpreted as an expression.
For example, you can use

'X: ' + string(x)

to display the value of the x-coordinate of the instance. (The variable x stores the current x-coordinate. The function string() turns this number into a string. + combines the two strings.)

image Draw Scaled Text
Standard Edition

This action is similar to the previous action but this time you can also specify a horizontal and vertical scaling factor to change the size of the text and you can specify an angle to rotate it.

image Draw Rectangle

You specify the coordinates of the two opposite corners of the rectangle; either absolute or relative to the current instance position.

image Horizontal Gradient
Standard Edition

This action also draws a rectangle but this time using a gradient color that changes from left to right. You specify the rectangle and the two colors to use.

image Vertical Gradient
Standard Edition

This action also draws a rectangle but this time using a gradient color that changes from top to bottom. You specify the rectangle and the two colors to use.

image Draw Ellipse

This action draws an ellipse. You specify the coordinates of the two opposite corners of the surrounding rectangle; either absolute or relative to the current instance position.

image Gradient Ellipse
Standard Edition

Again an ellipse is drawn but this time you specify a color for the center and the boundary.

image Draw Line

You specify the coordinates of the two endpoints of the line; either absolute or relative to the current instance position.

image Draw Arrow

Draws an arrow. You specify the coordinates of the two endpoints of the line and the size of the arrow tip.

 



image Set Color

Lets you set the color used for drawing shapes, lines, and text. (It does not influence the way sprites and backgrounds are drawn.)

image Set Font

You can set the font that is from this moment on used for drawing text. This must be one of the font resources you have define. If you choose No Font a default 12 point Arial font is used.

image Set Full Screen

With this action you can change the screen mode from windowed to fullscreen and back. You can indicate whether to toggle the mode or whether to go to windowed or fullscreen mode.

 



image Take Snapshot
Standard Edition

With this action you can take a snapshot image of the game and store it in a .bmp file. You specify the filename to store the image in.

image Create Effect
Standard Edition

With this action you can create all sorts of effects in a very simple way. You specify the type of effect, e.g. an explosion or smoke, its position, its size and its color and whether it should be shown below the objects or on top of them. For the rest it works automatic. (For rain and snow the position is irrelevant as it always falls down from the top of the screen. To get continuous rain you should create it in each step.)