File tree Expand file tree Collapse file tree 2 files changed +49
-0
lines changed Expand file tree Collapse file tree 2 files changed +49
-0
lines changed Original file line number Diff line number Diff line change 1+ # ViewportModule
2+
3+ This module allows you to create a viewport where you can zoom with mousewheel, and click/drag to move.
4+
5+ ## Import
6+
7+ ⚠ This module requires the [ GraphicEntityModule] ( https://github.com/CodinGame/codingame-game-engine/tree/master/engine/modules/entities ) to work.
8+
9+ Add this dependency in the ` pom.xml ` of your project:
10+
11+ ``` xml
12+ <dependency >
13+ <groupId >com.codingame.gameengine</groupId >
14+ <artifactId >module-viewport</artifactId >
15+ <version >3.7.0</version >
16+ </dependency >
17+ ```
18+
19+ And load the module in your ` config.js ` :
20+
21+ ``` javascript
22+ import { GraphicEntityModule } from ' ./entity-module/GraphicEntityModule.js' ;
23+ import { ViewportModule } from ' ./viewport-module/ViewportModule.js' ;
24+
25+ export const modules = [
26+ GraphicEntityModule,
27+ ViewportModule
28+ ];
29+ ```
30+
31+ ## Usage
32+
33+ In your ` Referee.java ` :
34+
35+ ``` java
36+ @Inject private GraphicEntityModule gem;
37+ @Inject ViewportModule viewportModule;
38+
39+ @Override
40+ public void init() {
41+ Group group = gem. createGroup();
42+
43+ // group.add(your entities)
44+
45+ viewportModule. createViewport(group);
46+ }
47+ ```
Original file line number Diff line number Diff line change 4949 statement : playground/extensions/extensions-toggle.md
5050 - title : Anim Module
5151 statement : playground/extensions/extensions-5-animmodule.md
52+ - title : Viewport Module
53+ statement : playground/extensions/extensions-6-viewport.md
5254 - title : Create your own modules
5355 statement : playground/extensions/extensions-2-tutorial.md
5456- title : One more thing
You can’t perform that action at this time.
0 commit comments