123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193 |
- = screen
- :author:
- :revnumber:
- :revdate: 2016/03/17 20:48
- :relfileprefix: ../../../
- :imagesdir: ../../..
- ifdef::env-github,env-browser[:outfilesuffix: .adoc]
- == The Screen Class
- You can create a screen using one of the two provided constructors as shown in the <<jme3/contributions/tonegodgui/quickstart#,Quick Start Guide>>.
- [source,java]
- ----
- // this = any JME Application
- Screen screen = new Screen(this);
- guiNode.addControl(screen);
- ----
- Optionally, you can provide a path to a custom Style theme:
- [source,java]
- ----
- // this = any JME Application
- Screen screen = new Screen(this, "tonegod/gui/style/def/style_map.xml");
- guiNode.addControl(screen);
- ----
- To make use of custom cursors, call this method prior to initializing the screen:
- [source,java]
- ----
- screen.setUseCustomCursors(true);
- ----
- You can disable and re-enable custom cursors at any point, but they must be initialized with the screen to be loaded.
- Cursor Effects can be enabled/disabled at anytime by calling:
- [source,java]
- ----
- screen.setUseCursorEffects(boolean useCursorEffects);
- ----
- Tool Tips can be enabled/disabled at anytime by calling:
- [source,java]
- ----
- screen.setUseToolTips(boolean useToolTips);
- ----
- Audio can be enabled/disabled at anytime by calling:
- [source,java]
- ----
- screen.setUseUIAudio(boolean useUIAudio);
- ----
- === Application quick references methods:
- [source,java]
- ----
- screen.getApplication();
- // Screen dimensions
- screen.getWidth();
- screen.getHeight();
- // Mouse position
- screen.getMouseXY(); // returns a Vector2f containing current mouse x/y
- ----
- === Methods for adding remove base level controls:
- [source,java]
- ----
- screen.addElement(Element element);
- screen.removeElement(Element element);
- ----
- === Z-Order Methods:
- [source,java]
- ----
- // Bring the specified Element to the front
- screen.updateZOrder(Element topMost);
- ----
- === Accessing the EffectManager:
- [source,java]
- ----
- screen.getEffectManager();
- ----
- === Retrieving a Style:
- [source,java]
- ----
- screen.getStyle(String tagName);
- ----
- === Custom Cursor Related Methods:
- [source,java]
- ----
- screen.setCursor(Screen.CursorType cur); // called by controls
- screen.setForcedCursor(Screen.CursorType cur); // Overrides control manipulation of cursor.
- screen.releaseForcedCursor(); // Release cursor manipulation back to controls
- ----
- === Retrieving Elements
- [source,java]
- ----
- // Recursive search
- screen.getElementById(String UID);
- ----
- === UI Global Alpha Settings:
- [source,java]
- ----
- screen.setGlobalAlpha(float globalAlpha);
- screen.getGlobalAlpha();
- ----
- === UI Global Audio Settings:
- [source,java]
- ----
- screen.setUseUIAudio(boolean useUIAudio);
- screen.getUseUIAudio();
- screen.setUIAudioVolume(float uiAudioVolume);
- screen.getUIAudioVolume();
- screen.playAudioNode(String key, float volume);
- ----
- === Enabling Global Texture Atlas Use
- Keep in mind, that it is possible to enable texture atlas usage per element without enabling global texture atlas use.
- [source,java]
- ----
- screen.setUseTextureAtlas(boolean useTextureAtlas, String texturePath);
- screen.getUseTextureAtlas();
- screen.getAtlasTexture();
- ----
|