Type [gd] | class (base class :) |
Inheritance | Image ➝ Display ➝ Object |
Overview | Creates and displays an image on the screen from a file or ImageSheet object. The local origin is at the center of the image. Initial anchor point is the center of the image also. Image objects can use the methods defined in Display class. |
See also [bg] |
Syntax
from png file:local p = Image(fileURL)
from ImageSheet object: local p = Image(object_ImageSheet, id_frame)
|
Examples
local img = Image('moon.png') |
local sht = ImageSheet('cat.png',512,256,8) local m = Image(sht,1) |
-- set initial x,y as 100,200local img = Image('moon.png'):setXY(100,200) |
-- set initial x,y as 100,200-- set initial rotational speed as 2 at the same timelocal img = Image(‘moon.png’):setXY(100,200):setDrot(2) |
local g = Group()local img = Image('moon.png')-- remove image after 5 secondsimg:removeAfter(5000)-- remove if x>1000function img:update(e)return x>1000 end |
댓글 없음:
댓글 쓰기