Table of Contents
6. Table gif¶
A table gif inherit from renderizable and implement all methods as usual. Also the animation has a shader table by default which can be accessed by getShader method.
6.1. gif methods¶
6.1.1. gif new¶
- new(string * world, number * x, number * y, number * z)¶
Create a new instance of a gif passing the world desired (detail) and position.
- Parameters
string – world can be
2ds
,2dw
or3d
.number – x position (optional).
number – y position (optional).
number – z position (optional).
- Returns
gif table.
Example:
tGif = gif:new('2dw')
6.1.2. gif load¶
For the gif example we will use the following gif:
mbm.setColor(0.3,0.3,0.7) --blue color of background
tGif = gif:new('2dw')
if tGif:load('Lion-King.gif') then
print('Successfully loaded gif:','Lion-King.gif')
else
print('Failed to loaded gif:','Lion-King.gif')
end
Note
The load method will search in all known path.
You can add a path to search by the method addPath.
6.1.3. gif setSize¶
- setSize(number width, number height)¶
Resize the frame size from gif.
- Parameters
number – width from frame.
number – height from frame.
Example:
mbm.setColor(1,1,1) --White color of background
tGif = gif:new('2dw')
if tGif:load('Lion-King.gif') then
tGif:setSize(100,100)
else
print('Failed to loaded gif:','Lion-King.gif')
end
Note
Always the image gif will adapt to the frame size.