Graphics.draw

From Moondust Wiki
Revision as of 23:14, 8 January 2016 by Kevsoft (talk | contribs)
Jump to navigation Jump to search

Graphics.draw is a function with access named arguments.

The list with accepted arguments:

Type Is Optional? Name Description
number no x The x coordinate
number no y The y coordinate
number no type (The type of the render operation. [RTYPE_TEXT or RTYPE_IMAGE])
boolean yes isSceneCoordinates If x and y should be used a scene coordinates
number yes priority The priority value

When type = RTYPE_TEXT then you can use:

Type Is Optional? Name Description
string no text The text to be drawn.
number yes fontType The type of the font, that should be used.

When type = RTYPE_IMAGE then you can use:

Type Is Optional? Name Description
LuaImageResource no image The image to be drawn.
number yes sourceX The x coordinate on the image to copy from.
number yes sourceY The y coordinate on the image to copy from.
number yes sourceWidth The width to copy from.
number yes sourceHeight The height to copy from.
number yes opacity The opacity of the image drawn.

Example

Graphics.draw {type = RTYPE_TEXT, x = 100, y = 100, text = "Hi!"}