Sub Activity_Pause (UserClosed As Boolean)
If lGdx.IsInitialized Then lGdx.Pause
End Sub
Sub Activity_Resume
If lGdx.IsInitialized Then lGdx.Resume
End Sub
Sub lGdx_Render
If AssetMgr.Update Then
'Loading in progress
...
Return
End If
'Loading is finished
...
Instances of this class own the returned array of points and the points themselves to avoid garbage collection as much as possible. Calling any of the methods will result in the reuse of the previously returned array and vectors, expect
Dim Interpolation As lgMathInterpolation
Interpolation = Interpolation.elastic
Dim myFirstInterpolatedValue As Float = Interpolation.apply(0)
Dim myLastInterpolatedValue As Float = Interpolation.apply(1)
A.mul(B) results in A := AB
Matrix4 mat = new Matrix4().trn(position).mul(camera.combined);
A.mul(B) results in A := AB.
A.mulLeft(B) results in A := BA.
Thanks to Riven on JavaGaming.org for the basis of sin/cos/floor/ceil.
All methods can be called from any thread unless otherwise noted.
One-off usage:
// 512x512 pixel pages, RGB565 format, 2 pixels of padding, border duplication PixmapPacker packer = new PixmapPacker(512, 512, Format.RGB565, 2, true); packer.pack("First Pixmap", pixmap1); packer.pack("Second Pixmap", pixmap2); TextureAtlas atlas = packer.generateTextureAtlas(TextureFilter.Nearest, TextureFilter.Nearest, false); packer.dispose(); // ... atlas.dispose();With this usage pattern, disposing the packer will not dispose any pixmaps used by the texture atlas. The texture atlas must also be disposed when no longer needed. Incremental texture atlas usage:
// 512x512 pixel pages, RGB565 format, 2 pixels of padding, no border duplication PixmapPacker packer = new PixmapPacker(512, 512, Format.RGB565, 2, false); TextureAtlas atlas = new TextureAtlas(); // potentially on a separate thread, e.g. downloading thumbnails packer.pack("thumbnail", thumbnail); // on the rendering thread, every frame packer.updateTextureAtlas(atlas, TextureFilter.Linear, TextureFilter.Linear, false); // once the atlas is no longer needed, make sure you get the final additions. This might // be more elaborate depending on your threading model. packer.updateTextureAtlas(atlas, TextureFilter.Linear, TextureFilter.Linear, false); // ... atlas.dispose();Pixmap-only usage:
PixmapPacker packer = new PixmapPacker(512, 512, Format.RGB565, 2, true); packer.pack("First Pixmap", pixmap1); packer.pack("Second Pixmap", pixmap2); // do something interesting with the resulting pages for (Page page : packer.getPages()) { // ... } packer.dispose();
An actor has a list of in progress {@link Action actions} that are applied to the actor (often over time). These are generally used to change the presentation of the actor (moving it, resizing it, etc). See {@link #act(float)}, {@link Action} and its many subclasses.
An actor has two kinds of listeners associated with it: "capture" and regular. The listeners are notified of events the actor or its children receive. The regular listeners are designed to allow an actor to respond to events that have been delivered. The capture listeners are designed to allow a parent or container actor to handle events before child actors. See {@link #fire} for more details.
An {@link InputListener} can receive all the basic input events. More complex listeners (like {@link ClickListener} and {@link ActorGestureListener}) can listen for and combine primitive events and recognize complex interactions like multi-touch or pinch.
Sub MyActor_Draw(SpriteBatch As lgSpriteBatch, ParentAlpha As Float)
Dim Actor As lgScn2DActor = Sender
SpriteBatch.SetColorRGBA(Actor.Color.R, Actor.Color.G, Actor.Color.B, Actor.Color.A * ParentAlpha)
SpriteBatch.DrawRegion3(MyTexRegion, Actor.X, Actor.Y, Actor.OriginX, Actor.OriginY, Actor.Width, Actor.Height, Actor.ScaleX, Actor.ScaleY, Actor.Rotation)
End Sub
By default an event will "bubble" up through an actor's parent's handlers (see {@link #setBubbles(boolean)}).
An actor's capture listeners can {@link #stop()} an event to prevent child actors from seeing it.
An Event may be marked as "handled" which will end its propagation outside of the Stage (see {@link #handle()}). The default {@link Actor#fire(Event)} will mark events handled if an {@link EventListener} returns true.
A cancelled event will be stopped and handled. Additionally, many actors will undo the side-effects of a canceled event. (See {@link #cancel()}.)
Actors have a z-order equal to the order they were inserted into the group. Actors inserted later will be drawn on top of actors added earlier. Touch events that hit more than one actor are distributed to topmost actors first.
Sub MyGroup_Draw(SpriteBatch As lgSpriteBatch, ParentAlpha As Float)
Dim Group As lgScn2DGroup = Sender
SpriteBatch.SetColorRGBA(Group.Color.R, Group.Color.G, Group.Color.B, Group.Color.A * ParentAlpha)
SpriteBatch.DrawRegion3(MyTexRegion, Group.X, Group.Y, Group.OriginX, Group.OriginY, Group.Width, Group.Height, Group.ScaleX, Group.ScaleY, Group.Rotation)
End Sub
actor.addListener(new InputListener() { public boolean touchDown (InputEvent event, float x, float y, int pointer, int button) { Gdx.app.log("Example", "touch started at (" + x + ", " + y + ")"); return false; } public void touchUp (InputEvent event, float x, float y, int pointer, int button) { Gdx.app.log("Example", "touch done at (" + x + ", " + y + ")"); } });
The preferred and min size of the stack is the largest preferred and min size of any children. The max size of the stack is the smallest max size of any children.
Sub MyGroup_Draw(SpriteBatch As lgSpriteBatch, ParentAlpha As Float)
Dim Group As lgScn2DGroup = Sender
SpriteBatch.SetColorRGBA(Group.Color.R, Group.Color.G, Group.Color.B, Group.Color.A * ParentAlpha)
SpriteBatch.DrawRegion3(MyTexRegion, Group.X, Group.Y, Group.OriginX, Group.OriginY, Group.Width, Group.Height, Group.ScaleX, Group.ScaleY, Group.Rotation)
End Sub