local IntervalTimer timer() sleep(1500) println( timer ) # prints: 1.50 seconds
class Game : Application
METHODS
method init_object:
open_archive( "gfx.zip" )
method init:
...
endClass
overlaying aspect MainDebug
METHODS
method init:
println( "+init" )
underlying
println( "-init" )
endAspect
augment Main : MainDebug;
can now be written like this:
overlaying augment MainDebug
METHODS
method init:
println( "+init" )
underlying
println( "-init" )
endAugment
class Alpha
PROPERTIES
a = 5 : Int32
endClass
class Beta : Alpha
PROPERTIES
b = 5 : Int32
METHODS
method init_object:
println( "Hello World" )
endClass
into this:
class Alpha : Object
PROPERTIES
a : Int32
METHODS
method init_object:
prior.init_object
a = 5
endClass
class Beta : Alpha
PROPERTIES
b = 5 : Int32
METHODS
method init_object:
prior.init_object
b = 5
println( "Hello World" )
endClass
init_object() methods are automatically called when an object is created and before the regular init() methods.
enum DIRECTION : BitFlags<<DIRECTION>>
CATEGORIES
north(1), east(2), south(4), west(8)
endEnum
...
local DIRECTION d = DIRECTION.north | DIRECTION.east
println( d == DIRECTION.north ) #prints: false
println( d.includes(DIRECTION.north) ) #prints: true
println( d ) #prints: north,east
println( d.flags ) #prints: 3
d &= !DIRECTION.north
println( d ) #prints: east
println( d == DIRECTION.east ) #prints: true
println( d.flags ) #prints: 2
filename filename.ext (.ext = [.png|.jpg|.jpeg]) data/filename data/filename.ext
Therefore you can now say 'img = Image("sprite")' if your image path is "data/sprite.png".
filename filename.ext (.ext = [.ogg|.wav|.mod|.flac|.aiff]) data/filename data/filename.ext
local Corners existing_corners = img.uv
img.uv = Corners( 1.0/128.0, 1.0/128.0, 127/128.0, 127/128.0 )
or
img.crop(1) # take off a 1-pixel border
size = Vector2(128,128) # restore nominal size from 126x126 to 128x128
augment Image
METHODS
method draw( Real64 x, Real64 y ):
draw( Vector2(x,y) )
endAugment
on_key_pressed on_key_typed on_key_released on_mouse_button_pressed on_mouse_button_released
to
on_key_press on_keystroke on_key_release on_mouse_button_press on_mouse_button_release