Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 0
Creating game instance
Tymon Woźniak edited this page Apr 21, 2023
·
2 revisions
Creating Game instance
To create Game instance firstly you need to create grid, Page Settings, Canvas Scale.
| Param | Description |
|---|---|
Vector2 Grid | Grid is visible scalable grid on canvas |
object Page Settings | { backgroundColor: STRING } |
float Canvas Scale | Used for canvas scaling. Represents scale of parent element. |
JSGL.DefaultGame.Create(GAME_SETTINGS,PAGE_SETTINGS,CANVAS_SCALE);constGRID=newJSGL.Vector2(16,9);// this is not aspect ratio!constBACKGROUND_COLOR='black';constCANVAS_SCALE=1;constGAME_SETTINGS={grid: GRID};constPAGE_SETTINGS={backgroundColor: BACKGROUND_COLOR};constgame=JSGL.DefaultGame.Create(GAME_SETTINGS,PAGE_SETTINGS,CANVAS_SCALE);constgame=JSGL.DefaultGame.Create({grid: newJSGL.Vector2(10,10)},{backgroundColor: 'black'});