Ecosystem bridges · BUILT-IN MODULE
game
Small canvas-game scene builder.
Quick start
use game
scene = game.new 640 360 "SE Game"
game.background scene "#111"
game.circle scene 320 180 50 "#8b7cff" true
try game.show sceneAPI reference
game.new width height titleCreate a game scene and return its id.
建立 a game scene and return its id.
game.background scene colorSet scene background.
設定 scene background.
game.clear sceneClear draw commands.
Clear draw commands.
game.rect scene x y width height color fillDraw a rectangle.
Draw a rectangle.
game.circle scene x y radius color fillDraw a circle.
Draw a circle.
game.line scene x1 y1 x2 y2 color widthDraw a line.
Draw a line.
game.text scene text x y size colorDraw text.
Draw text.
game.script scene javascriptAppend browser JavaScript to a scene.
加入 browser JavaScript to a scene.
game.html sceneReturn generated scene HTML.
回傳 generated scene HTML.
game.save scene pathSave scene HTML. Fallible.
Save scene HTML. 此操作可能失敗。
game.show sceneOpen scene in a browser. Fallible.
開啟 scene in a browser. 此操作可能失敗。