jSimpleGameEngine
SGE
Events:
- Render (ElapsedSinceLastFrame As Double)
- Start
- Stop
- Update (ElapsedSinceLastFrame As Double)
Functions:
- GetDeviceNumberOfColors (Index As Int) As Long
Returns the number of colors displayed by the device with the given index.
- GetDeviceRefreshRate (Index As Int) As Int
Returns the refresh rate in Hz of the device with the given index.
- Initialize (EventPrefix As String, AnimationSmoothness As Int)
Initializes the engine.
Once initialized, StartLoop can be called to start the game loop and raise events.
AnimationSmoothness: A value between 1 (animations may be choppy but the elapsed time given by the events is accurate) and 20 (animations are very smooth but the elapsed time is averaged, and thus not accurate). 10 should be fine for most cases.
- IsInitialized As Boolean
- IsLoopRunning As Boolean
Returns whether the game loop is running.
- PauseLoop
Stops raising the Update and Render events. To restart the loop, call StartLoop.
- RemoveNodeFromParent
- RequestFocus
- SetAlphaAnimated (arg0 As Int, arg1 As Double)
- SetSize (arg0 As Double, arg1 As Double)
- Snapshot As Image
- Snapshot2 (arg0 As javafx.scene.paint.Paint) As Image
- StartLoop
Initializes the input interface, raises a Start event then starts the game loop.
Once started, the loop will raise regularly Update and Render events.
If the loop is paused by PauseLoop, this function restarts the loop without raising the Start event.
- StopLoop
Stops the game loop and raises a Stop event.
- SwitchToScreen (Screen As sgeScreen)
Stops the game loop, switches to the specified screen and restarts the loop.
All events are redirected. To raise again the initial events, set Screen to Null .
Properties:
- Alpha As Double
- Camera As sgeCamera [read only]
Returns the camera instance. By default, the camera is centered on the canvas origin (0, 0).
- CurrentScreen As sgeScreen [read only]
Returns the active screen.
- CurrentTimeNano As Long [read only]
Returns the current value of the system timer, in nanoseconds.
- Enabled As Boolean
- FPS As Double [read only]
Returns the number of frames per second. Returns -1 if the game loop is not running.
- Graphics As sgeGraphics [read only]
Returns the graphics instance.
- Height As Double
- Id As String
- Input As sgeInput [read only]
Returns the input instance.
- Left As Double
- MouseCursor As javafx.scene.Cursor
- Parent As Node [read only]
- PickOnBounds As Boolean
- PrefHeight As Double
- PrefWidth As Double
- Root As sgeRootGroup [read only]
Returns the root group which holds all actors.
- Style As String
- StyleClasses As List [read only]
- Tag As Object
- Top As Double
- Visible As Boolean
- Width As Double
sgeAction
Functions:
- Then (Action As sgeAction) As sgeAction
The specified action will be performed after this one is finished.
- With (Action As sgeAction) As sgeAction
The specified action will be performed in parallel with this action.
Properties:
- Finished As Boolean [read only]
- Progression As Double [read only]
sgeActions
Events:
- ActionEnd
- ActionProgression (Progression As Double, Data As Object)
Functions:
- ChangeAlpha (ToAlpha As Double) As sgeAction
Changes instantly the opacity value of the actor to the specified value.
- ChangeAlpha2 (ToAlpha As Double, DurationInMillis As Int) As sgeAction
Changes the opacity value of the actor to the given value over the specified duration (in milliseconds). Returns the current Alpha in the ActionProgression event.
- ChangeAlpha3 (ToAlpha As Double, DurationInMillis As Int, Interpolator As javafx.animation.Interpolator) As sgeAction
Changes the opacity value of the actor to the given value over the specified duration (in milliseconds). Returns the current Alpha in the ActionProgression event.
- ChangeValue (FromValue As Double, ToValue As Double, DurationInMillis As Int) As sgeAction
Changes a value from FromValue to ToValue over the specified duration (in milliseconds). Returns the current value in the ActionProgression event.
- ChangeValue2 (FromValue As Double, ToValue As Double, DurationInMillis As Int, Interpolator As javafx.animation.Interpolator) As sgeAction
Changes a value from FromValue to ToValue over the specified duration (in milliseconds). Returns the current value in the ActionProgression event.
- ChangeVisibility As sgeAction
Toggles the visible state of the actor.
- ChangeVisibility2 (Visible As Boolean) As sgeAction
Changes the visible state of the actor to the specified value.
- ChangeVisualObject (NewVisualObject As Object) As sgeAction
Changes the visual object of the actor to the specified object. This action cannot be assigned to a group.
- Flip (FlipX As Boolean, FlipY As Boolean) As sgeAction
Flips the actor on the X and Y axis according to the specified values.
- FollowThisPath (Waypoints As List, OrientToPath As Boolean, Speed As Double) As sgeAction
Moves the actor along the path described by Waypoints (a list of sgePoint2D) at the specified speed (in pixels per millisecond).
Returns the current list index in the ActionProgression event.
OrientToPath: Whether the actor is rotated so its right side faces the move direction.
- FollowThisPath2 (Waypoints As List, OrientToPath As Boolean, RotationOffset As Double, Speed As Double) As sgeAction
Moves the actor along the path described by Waypoints (a list of sgePoint2D) at the specified speed (in pixels per millisecond).
Returns the current list index in the ActionProgression event.
OrientToPath: Whether the actor is rotated so its right side faces the move direction.
RotationOffset: The value in degrees to add to the Rotation property when OrientToPath is True.
- GoToActor (Actor As sgeActor) As sgeAction
Moves the actor instantly to the position of the given actor.
- GoToActor2 (Actor As sgeActor, DurationInMillis As Int) As sgeAction
Moves the actor to the position of the given actor over the specified duration (in milliseconds).
- GoToActor3 (Actor As sgeActor, DurationInMillis As Int, Interpolator As javafx.animation.Interpolator) As sgeAction
Moves the actor to the position of the given actor over the specified duration (in milliseconds).
- MoveTo (X As Double, Y As Double) As sgeAction
Moves the actor instantly to the given position.
- MoveTo2 (X As Double, Y As Double, DurationInMillis As Int) As sgeAction
Moves the actor to the given position over the specified duration (in milliseconds).
- MoveTo3 (X As Double, Y As Double, Speed As Double) As sgeAction
Moves the actor to the given position at the specified speed (in pixels per millisecond).
- MoveTo4 (X As Double, Y As Double, DurationInMillis As Int, Interpolator As javafx.animation.Interpolator) As sgeAction
Moves the actor to the given position over the specified duration (in milliseconds).
- RaiseEvent (EventName As String) As sgeAction
Raises the specified event.
- RemoveFromParent As sgeAction
Removes the actor from its parent group.
- Resize (Width As Double, Height As Double) As sgeAction
Changes instantly the width and height of the actor to the specified values. This action cannot be assigned to a group.
- Resize2 (Width As Double, Height As Double, DurationInMillis As Int) As sgeAction
Changes the width and height of the actor to the given values over the specified duration (in milliseconds). This action cannot be assigned to a group.
- Resize3 (Width As Double, Height As Double, DurationInMillis As Int, Interpolator As javafx.animation.Interpolator) As sgeAction
Changes the width and height of the actor to the given values over the specified duration (in milliseconds). This action cannot be assigned to a group.
- Rotate (Degrees As Double) As sgeAction
Changes instantly the rotation angle of the actor to the specified value (in degrees).
- Rotate2 (Degrees As Double, DurationInMillis As Int) As sgeAction
Changes the rotation angle of the actor to the given value over the specified duration (in milliseconds). Returns the current angle in the ActionProgression event.
- Rotate3 (Degrees As Double, DurationInMillis As Int, Interpolator As javafx.animation.Interpolator) As sgeAction
Changes the rotation angle of the actor to the given value over the specified duration (in milliseconds). Returns the current angle in the ActionProgression event.
- Scale (X As Double, Y As Double) As sgeAction
Changes instantly the ScaleX and ScaleY values of the actor to the given values.
- Scale2 (X As Double, Y As Double, DurationInMillis As Int) As sgeAction
Changes the ScaleX and ScaleY values of the actor to the given values over the specified duration (in milliseconds).
- Scale3 (X As Double, Y As Double, DurationInMillis As Int, Interpolator As javafx.animation.Interpolator) As sgeAction
Changes the ScaleX and ScaleY values of the actor to the given values over the specified duration (in milliseconds).
- SetActionToActor (Action As sgeAction, Actor As flm.b4j.simplegameengine.actors.AbstractActor) As sgeAction
Assigns the given action to the specified actor.
- SynchronizeWith (Actor As flm.b4j.simplegameengine.actors.AbstractActor) As sgeAction
Waits until the specified actor sends a synchronization signal via SynchronizeWith.
- Wait (DelayInMillis As Long) As sgeAction
Waits for the specified period of time (in milliseconds). Returns the elapsed time in the ActionProgression event.
sgeActor
Events:
- ActionEnd
- ActionProgression (Progression As Double, Data As Object)
- Draw (X As Double, Y As Double, Width As Double, Height As Double)
Fields:
Functions:
- ClearActions
Clears all actions of this actor. The actions in progress are cancelled.
- Draw
Draws the visual object of this actor.
- Initialize (Parent As sgeGroup, EventPrefix As String)
Creates a new actor with no visual object.
- InitializeWithAnimation (Animation As sgeAnimation, Parent As sgeGroup, EventPrefix As String)
Creates a new actor with the specified Animation.
- InitializeWithImage (Image As Image, Parent As sgeGroup, EventPrefix As String)
Creates a new actor with the specified Image.
- InitializeWithNinePatch (NinePatch As sgeNinePatch, Parent As sgeGroup, EventPrefix As String)
Creates a new actor with the specified NinePatch.
- InitializeWithRegion (Region As sgeRegion, Parent As sgeGroup, EventPrefix As String)
Creates a new actor with the specified Region.
- InitializeWithText (Text As sgeText, Parent As sgeGroup, EventPrefix As String)
Creates a new actor with the specified Text.
- IsAnimationStopped As Boolean
- IsInitialized As Boolean
- PerformAction (ElapsedInMillis As Long)
Updates the data of the action assigned to this actor. Should be called in the Update event.
- RemoveFromParent
Removes this actor from its parent group and destroys its visual object.
- SetAnimation (Animation As sgeAnimation)
- SetImage (Image As Image)
- SetLocalPosition (X As Double, Y As Double)
Sets the local position of this actor. The LocalX,LocalY coordinates are relative to the parent's coordinates.
- SetNinePatch (NinePatch As sgeNinePatch)
- SetPosition (X As Double, Y As Double)
Sets the global position of this actor. The X,Y coordinates are relative to the canvas origin.
- SetRegion (Region As sgeRegion)
- SetRepeatedAction (Action As sgeAction, Count As Int)
Repeats the specified action the given number of times (or forever if Count is set to REPEAT_FOREVER). This action is repeated only after all actions linked with Then and With are finished.
- SetScale (Scale As Double)
Gets or sets the scale of this actor in both directions.
- SetSize (Width As Double, Height As Double)
Sets the size of this actor.
- SetText (Text As sgeText)
- StartAnimation
- StopAnimation
Properties:
- Action As sgeAction
Gets or sets the action to be performed.
- ActorWaitingSynchronization As flm.b4j.simplegameengine.actors.AbstractActor [read only]
Returns the actor sending a synchronization signal and waiting for this actor to do the same.
- Alpha As Double
Gets or sets the opacity value of this actor.
- BoundingBox As sgeBoundingBox [read only]
Returns the bounding box containing this actor.
- BoundingBox2 As sgeBoundingBox [read only]
Returns the bounding box containing this actor, taking into account drawing offsets, rotation angle and scales.
- CenterX As Double [read only]
- CenterY As Double [read only]
- DrawingOffsetX As Double
Gets or sets the offset between the X coordinate and the drawing position. Default = 0.
- DrawingOffsetY As Double
Gets or sets the offset between the Y coordinate and the drawing position. Default = 0.
- Effect As flm.b4j.simplegameengine.effects.AbstractEffect
Gets or sets the effect applied to this actor. Note that effects are not cumulative. So any effect applied to a group will be ignored by an actor of this group having its own effect.
- FlipX As Boolean
Gets or sets whether this actor is flipped on the X axis.
- FlipY As Boolean
Gets or sets whether this actor is flipped on the Y axis.
- Height As Double
Gets or sets the height of this actor.
- LocalCenterX As Double [read only]
- LocalCenterY As Double [read only]
- LocalX As Double
Gets or sets the local X position of this actor. The LocalX,LocalY coordinates are relative to the parent's coordinates.
- LocalY As Double
Gets or sets the local Y position of this actor. The LocalX,LocalY coordinates are relative to the parent's coordinates.
- Parent As sgeGroup
Gets or sets the group containing this actor.
- RotateAroundCenter As Boolean
Gets or sets whether the rotation is done around the center (true) or around the origin (false).
- Rotation As Double
Gets or sets the rotation angle in degrees.
- ScaleX As Double
Gets or sets the scale of this actor in the horizontal direction relative to its width.
- ScaleY As Double
Gets or sets the scale of this actor in the vertical direction relative to its height.
- Tag As Object
- Vehicle As sgeVehicle
Gets or sets the vehicle associated to this actor.
- Visible As Boolean
Gets or sets whether this actor is shown or hidden.
- VisualObject As Object [read only]
- Width As Double
Gets or sets the width of this actor.
- X As Double
Gets or sets the global X position. The X,Y coordinates are relative to the canvas origin.
- Y As Double
Gets or sets the global Y position. The X,Y coordinates are relative to the canvas origin.
- ZOrder As Int
Gets or sets the Z-order (position in the drawing list of the actor's parent). 0 = first actor to be drawn.
sgeAnimation
Fields:
Functions:
- GetFrame (Index As Int) As Object
Returns the frame with the specified index.
- GetFrame2 (ElapsedInMillis As Int) As Object
Returns a frame by its position in the timeline.
- Initialize (Frames As Image(), FrameDurationInMillis As Int, RepeatCount As Int)
Creates an animation with the given frames.
- Initialize2 (Frames As sgeRegion(), FrameDurationInMillis As Int, RepeatCount As Int)
Creates an animation with the given frames.
- IsInitialized As Boolean
Properties:
- AutoReverse As Boolean
Gets or sets whether the frames are automatically played in reverse order when the last frame is reached. Default = False.
- FrameCount As Int [read only]
Returns the number of frames of this animation.
- FrameDuration As Int
Gets or sets the duration of each frame in milliseconds.
- Interpolator As javafx.animation.Interpolator
Gets or sets the interpolation behavior of this animation.
- Reversed As Boolean
Gets or sets whether the frames are played in reverse order. Default = False.
- TotalDuration As Int [read only]
Returns the total duration of this animation in milliseconds.
sgeAssetManager
Events:
- Error (Reason As String, AssetType As String, Dir As String, FileName As String)
- Loaded
- Loading (AssetType As String, AssetName As String, Dir As String, FileName As String, Progression As Float)
Fields:
- FONT As String
- IMAGE As String
- MUSIC As String
- NAVIG_GRID As String
- SOUND As String
- TEXT As String
- TILED_MAP As String
Functions:
- Add (Type As String, Name As String, Dir As String, FileName As String)
Adds the specified asset to the list of assets to load. The asset name must be unique for the given type.
- Clear
Clears the list of assets.
- Contains (Type As String, Name As String) As Boolean
Returns whether the given asset is in the list of assets.
- GetFileName (Type As String, Name As String) As String
Returns the filename of the specified asset.
- GetFont (Name As String, Size As Int) As Font
Returns the font with the specified name and size from the loaded assets.
- GetImage (Name As String) As Image
Returns the image with the specified name from the loaded assets.
- GetMapDependencies (TiledMap As sgeTiledMap) As List
Returns a list containing the filename of all resources used by the specified map.
- GetMusic (Name As String) As sgeMusic
Returns the music with the specified name from the loaded assets.
- GetNavigationGrid (Name As String) As sgeNavigationGrid
Retrieves the navigation grid with the specified name from the loaded assets and returns a copy.
- GetSound (Name As String) As sgeSound
Returns the sound with the specified name from the loaded assets.
- GetText (Name As String) As String
Returns the text with the specified name from the loaded assets.
- GetText2 (Name As String) As sgeText
Returns the text asset with the specified name as a sgeText object.
- GetTiledMap (Name As String) As sgeTiledMap
Returns the tiled map with the specified name from the loaded assets.
- Initialize (EventPrefix As String)
Initializes the asset manager.
- IsInitialized As Boolean
- LoadAllAssets
Loads all assets on a background thread.
Raises a Loading event before loading each asset, then a Loaded event when the task is finished.
If a loading fails, an Error event is raised and the operation is cancelled.
- LoadThisAsset (Type As String, Name As String)
Loads the given asset on a background thread.
Raises a Loading event before loading this asset, then a Loaded event when the task is finished.
If the loading fails, an Error event is raised.
- Remove (Type As String, Name As String)
Removes the given asset from the list of assets.
- Split (Name As String, NumberOfColumns As Int, NumberOfRows As Int) As sgeRegion()
Creates an array of regions from the specified image asset according to the given number of rows and columns.
- Split2 (Name As String, ColumnSize As Int, RowSize As Int) As sgeRegion()
Creates an array of regions from the specified image asset according to the given size in pixels of rows and columns.
- SplitNinePatch (Name As String) As sgeRegion(,)
Creates an array of 3x3 regions from the specified asset (a 9-patch PNG image).
- SplitNinePatch2 (Name As String) As sgeNinePatch
Creates a NinePatch object from the specified asset (a 9-patch PNG image).
- toString As String
sgeBehavior
Functions:
- Weight (Weight As Double) As sgeBehavior
Sets the weight of this behavior relative to the other behaviors. Default = 1.0.
- With (Behavior As sgeBehavior) As sgeBehavior
The specified behavior will be applied in parallel with this behavior.
sgeBehaviorFollowPath
Functions:
- Weight (Weight As Double) As sgeBehavior
Sets the weight of this behavior relative to the other behaviors. Default = 1.0.
- With (Behavior As sgeBehavior) As sgeBehavior
The specified behavior will be applied in parallel with this behavior.
Properties:
- Waypoint As Int
Gets or sets the current waypoint index.
- WaypointRadius As Double
Gets or sets the radius of the waypoint area. When the vehicle enters this area, the next waypoint is selected.
sgeBehaviors
Functions:
- Align (Vehicles As sgeVehicle(), RadiusAround As Double) As sgeBehavior
Aligns the vehicle with other nearby vehicles.
RadiusAround: Only the vehicles within this radius will be taken into account.
- Arrive (Location As sgePoint2D, SlowingRadius As Double) As sgeBehavior
Seeks the given location. If SlowingRadius is > 0, the vehicle velocity is reduced as it approaches the destination.
SlowingRadius: Radius in pixels of the arrival area in which the vehicle decelerates.
- Cohere (Vehicles As sgeVehicle(), RadiusAround As Double) As sgeBehavior
Directs the vehicle towards other nearby vehicles.
RadiusAround: Only the vehicles within this radius will be taken into account.
- Evade (Predator As sgeVehicle) As sgeBehavior
Flees from the given vehicle.
- Flee (Location As sgePoint2D) As sgeBehavior
Flees the given location.
- FollowPath (Waypoints As List, WaypointRadius As Double, SlowTurn As Boolean) As sgeBehavior
Moves the vehicle along the path described by Waypoints (a list of sgePoint2D).
WaypointRadius: Radius of the waypoint area. When the vehicle enters this area, the next waypoint is selected.
SlowTurn: Whether the vehicle slows down when it enters the waypoint area (Arrive behavior) or not (Seek behavior).
- Pursue (Quarry As sgeVehicle) As sgeBehavior
Seeks the future location of the given vehicle.
- RaiseEvent (EventName As String, Data As Object) As sgeBehavior
Raises the specified event when ApplyBehavior is called. Allows to create a custom behavior.
The event has to return a sgePoint2D representing a steering force.
Data: Object to be passed to the event. It may be null.
- Seek (Location As sgePoint2D) As sgeBehavior
Seeks the given location.
- Separate (Vehicles As sgeVehicle(), Distance As Double) As sgeBehavior
Keeps the vehicle at a certain distance from the specified vehicles.
sgeBoundingBox
Functions:
- Area As Double
Returns the area of this bounding box.
- Contains (Point2D As sgePoint2D) As Boolean
Tests if the specified point is inside the boundary of this bounding box.
- Contains2 (X As Double, Y As Double) As Boolean
Tests if the specified point is inside the boundary of this bounding box.
- Contains3 (BoundingBox As sgeBoundingBox) As Boolean
Tests if the interior of this bounding box entirely contains the specified bounding box.
- Equals (BoundingBox As sgeBoundingBox) As Boolean
Tests if the specified bounding box has the same position and dimensions as this bounding box.
- Initialize (X As Double, Y As Double, Width As Double, Height As Double)
Creates a rectangular bounding box.
- IsInitialized As Boolean
Properties:
- Bottom As Double [read only]
- Center As sgePoint2D [read only]
- Height As Double [read only]
- Right As Double [read only]
- Tag As Object
- Width As Double [read only]
- X As Double [read only]
- Y As Double [read only]
sgeCamera
Fields:
Functions:
- CenterOn (X As Double, Y As Double)
Centers the camera on the given coordinates (in pixels).
- SetBoundaries (Left As Double, Right As Double, Top As Double, Bottom As Double)
Defines the boundaries of the camera position. If the camera can move infinitely in a direction, set the value for this direction to NO_LIMIT.
Properties:
- LeftX As Double [read only]
Returns the leftmost position of the current view.
- TopY As Double [read only]
Returns the topmost position of the current view.
- X As Double
- Y As Double
- Zoom As Double
Gets or sets the zoom factor of the camera.
sgeCircle
Functions:
- Area As Double
Returns the area of this circle.
- Circumference As Double
Returns the circumference of this circle.
- Contains (Point2D As sgePoint2D) As Boolean
Tests if the specified point is inside this circle.
- Contains2 (X As Double, Y As Double) As Boolean
Tests if the specified point is inside this circle.
- Equals (Circle As sgeCircle) As Boolean
Tests if the specified circle has the same position and radius as this circle.
- Initialize (CenterX As Double, CenterY As Double, Radius As Double)
Creates a circle.
- IsInitialized As Boolean
Properties:
- CenterX As Double
- CenterY As Double
- Radius As Double
- Tag As Object
sgeEffectBlend
Fields:
- MODE_ADD As javafx.scene.effect.BlendMode
The color and alpha components from the top input are added to those from the bottom input.
- MODE_BLUE As javafx.scene.effect.BlendMode
The blue component of the bottom input is replaced with the blue component of the top input; the other color components are unaffected.
- MODE_COLOR_BURN As javafx.scene.effect.BlendMode
The inverse of the bottom input color components are divided by the top input color components, all of which is then inverted to produce the resulting color.
- MODE_COLOR_DODGE As javafx.scene.effect.BlendMode
The bottom input color components are divided by the inverse of the top input color components to produce the resulting color.
- MODE_DARKEN As javafx.scene.effect.BlendMode
The darker of the color components from the two inputs are selected to produce the resulting color.
- MODE_DIFFERENCE As javafx.scene.effect.BlendMode
The darker of the color components from the two inputs are subtracted from the lighter ones to produce the resulting color.
- MODE_EXCLUSION As javafx.scene.effect.BlendMode
The color components from the two inputs are multiplied and doubled, and then subtracted from the sum of the bottom input color components, to produce the resulting color.
- MODE_GREEN As javafx.scene.effect.BlendMode
The green component of the bottom input is replaced with the green component of the top input; the other color components are unaffected.
- MODE_HARD_LIGHT As javafx.scene.effect.BlendMode
The input color components are either multiplied or screened, depending on the top input color.
- MODE_LIGHTEN As javafx.scene.effect.BlendMode
The lighter of the color components from the two inputs are selected to produce the resulting color.
- MODE_MULTIPLY As javafx.scene.effect.BlendMode
The color components from the first input are multiplied with those from the second input.
- MODE_OVERLAY As javafx.scene.effect.BlendMode
The input color components are either multiplied or screened, depending on the bottom input color.
- MODE_RED As javafx.scene.effect.BlendMode
The red component of the bottom input is replaced with the red component of the top input; the other color components are unaffected.
- MODE_SCREEN As javafx.scene.effect.BlendMode
The color components from both of the inputs are inverted, multiplied with each other, and that result is again inverted to produce the resulting color.
- MODE_SOFT_LIGHT As javafx.scene.effect.BlendMode
The input color components are either darkened or lightened, depending on the top input color.
- MODE_SRC_ATOP As javafx.scene.effect.BlendMode
The part of the top input lying inside of the bottom input is blended with the bottom input.
- MODE_SRC_OVER As javafx.scene.effect.BlendMode
The top input is blended over the bottom input.
Functions:
- Initialize
Creates a new Blend effect with default parameters.
- Initialize2 (Mode As javafx.scene.effect.BlendMode, BottomInput As flm.b4j.simplegameengine.effects.AbstractEffect, TopInput As flm.b4j.simplegameengine.effects.AbstractEffect)
Creates a new Blend effect with the specified mode and bottom and top inputs.
Properties:
- BottomInput As flm.b4j.simplegameengine.effects.AbstractEffect [write only]
Sets the bottom input for this Blend operation.
- Mode As javafx.scene.effect.BlendMode
Gets or sets the mode used to blend the two inputs together.
- Opacity As Double
Gets or sets the opacity value, which is modulated with the top input prior to blending. From 0 to 1.
- TopInput As flm.b4j.simplegameengine.effects.AbstractEffect [write only]
Sets the top input for this Blend operation.
sgeEffectBloom
Functions:
- Initialize (Threshold As Double)
Creates a new Bloom effect with the given threshold.
Properties:
- Threshold As Double
Gets or sets the threshold value, which controls the minimum luminosity value of the pixels that will be made to glow. From 0 to 1.
sgeEffectBoxBlur
Functions:
- Initialize
Creates a new BoxBlur effect with default parameters.
- Initialize2 (Width As Double, Height As Double, Iterations As Int)
Creates a new BoxBlur effect with the specified width, height and iterations.
Properties:
- Height As Double
Gets or sets the vertical dimension of the blur effect. From 0 to 255.
- Iterations As Int
Gets or sets the number of times to iterate the blur effect to improve its "quality" or "smoothness". From 0 to 3.
- Width As Double
Gets or sets the horizontal dimension of the blur effect. From 0 to 255.
sgeEffectColorAdjust
Functions:
- Initialize
Creates a new ColorAdjust effect with default parameters.
- Initialize2 (Hue As Double, Saturation As Double, Brightness As Double, Contrast As Double)
Creates a new ColorAdjust effect with the specified hue, saturation, brightness, and contrast.
Properties:
- Brightness As Double
Gets or sets the brightness adjustment value. From -1 to 1.
- Contrast As Double
Gets or sets the contrast adjustment value. From -1 to 1.
- Hue As Double
Gets or sets the hue adjustment value. From -1 to 1.
- Saturation As Double
Gets or sets the saturation adjustment value. From -1 to 1.
sgeEffectColorInput
Functions:
- Initialize
Creates a new ColorInput with default parameters.
- Initialize2 (X As Double, Y As Double, Width As Double, Height As Double, Color As javafx.scene.paint.Paint)
Creates a new ColorInput with the specified position, dimensions, and color.
X and Y are in the coordinate space of the node. To take the camera position into account, subtract sgeCamera.LeftX from X and sgeCamera.TopY from Y.
Properties:
- Color As javafx.scene.paint.Paint
Gets or sets the color used to flood the region.
- Height As Double
Gets or sets the height of the region to be flooded.
- Width As Double
Gets or sets the width of the region to be flooded.
- X As Double
Gets or sets the X location of the region to be flooded.
X is in the coordinate space of the node. To take the camera position into account, subtract sgeCamera.LeftX from X.
- Y As Double
Gets or sets the Y location of the region to be flooded.
Y is in the coordinate space of the node. To take the camera position into account, subtract sgeCamera.TopY from Y.
sgeEffectDisplacementMap
Functions:
- ClearMap
Clears the displacement data.
- Initialize (Width As Int, Height As Int)
Creates a new DisplacementMap effect with the specified dimensions.
- Set (Output As sgePoint2D, Displacement As sgePoint2D)
Sets the specified displacement for the given output position.
Output: Output position. Output.X cannot be greater than Width-1 and Output.Y cannot be greater than Height-1.
Displacement: Percentages of offset between the input and the output positions, e.g. if Output.X = 100 and Displacement.X = -0.5, Input.X = 100 + (-0.5 * Width).
- Set2 (OutputX As Int, OutputY As Int, DisplacementX As Float, DisplacementY As Float)
Sets the specified displacement for the given output position.
OutputX,OutputY: Output position. OutputX cannot be greater than Width-1 and OutputY cannot be greater than Height-1.
DisplacementX,DisplacementY: Percentages of offset between the input and the output positions, e.g. if OutputX = 100 and DisplacementX = -0.5, InputX = 100 + (-0.5 * Width).
Properties:
- DisplacementMap As Map
Gets or sets the map that determines how input pixels are mapped to output pixels.
Key = Output position (sgePoint2D). Output.X cannot be greater than Width-1 and Output.Y cannot be greater than Height-1.
Value = Displacement (sgePoint2D). Percentages of offset between the input and the output positions, e.g. if Output.X = 100 and Displacement.X = -0.5, Input.X = 100 + (-0.5 * Width).
- Height As Int [read only]
- OffsetX As Int
Gets or sets the offset in pixels by which all X coordinate offset values in the map are displaced after they are scaled. Default = 0.
- OffsetY As Int
Gets or sets the offset in pixels by which all Y coordinate offset values in the map are displaced after they are scaled. Default = 0.
- ScaleX As Double
Gets or sets the scale factor by which all X coordinate offset values in the map are multiplied. Default = 1.0.
- ScaleY As Double
Gets or sets the scale factor by which all Y coordinate offset values in the map are multiplied. Default = 1.0.
- Width As Int [read only]
- Wrap As Boolean
Gets or sets whether values taken from outside the edges of the map "wrap around" or not. Default = False.
sgeEffectDropShadow
Fields:
- BLURTYPE_GAUSSIAN As javafx.scene.effect.BlurType
- BLURTYPE_ONE_PASS_BOX As javafx.scene.effect.BlurType
- BLURTYPE_THREE_PASS_BOX As javafx.scene.effect.BlurType
- BLURTYPE_TWO_PASS_BOX As javafx.scene.effect.BlurType
Functions:
- Initialize
Creates a new DropShadow effect with default parameters.
- Initialize2 (Radius As Double, Color As javafx.scene.paint.Color)
Creates a new DropShadow effect with the specified radius and color.
- Initialize3 (Radius As Double, OffsetX As Double, OffsetY As Double, Color As javafx.scene.paint.Color)
Creates a new DropShadow effect with the specified radius, offsetX, offsetY and color.
Properties:
- BlurType As javafx.scene.effect.BlurType
Gets or sets the algorithm used to blur the shadow (one of the BLURTYPE_... constants).
- Color As javafx.scene.paint.Color
Gets or sets the shadow color.
- Height As Double
Gets or sets the vertical size of the shadow blur kernel. From 0 to 255.
- OffsetX As Double
Gets or sets the shadow offset in the X direction, in pixels.
- OffsetY As Double
Gets or sets the shadow offset in the Y direction, in pixels.
- Radius As Double
Gets or sets the radius of the shadow blur kernel. From 0 to 127.
- Spread As Double
Gets or sets the spread of the shadow. From 0 to 1.
- Width As Double
Gets or sets the horizontal size of the shadow blur kernel. From 0 to 255.
sgeEffectGaussianBlur
Functions:
- Initialize (Radius As Double)
Creates a new GaussianBlur effect with the given radius.
Properties:
- Radius As Double
Gets or sets the radius of the blur kernel. From 0 to 63.
sgeEffectGlow
Functions:
- Initialize (Level As Double)
Creates a new Glow effect with the given intensity.
Properties:
- Level As Double
Gets or sets the intensity of the Glow effect. From 0 to 1.
sgeEffectImageInput
Functions:
- Initialize
Creates a new ImageInput with default parameters.
- Initialize2 (Source As Image)
Creates a new ImageInput with the specified source.
- Initialize3 (Source As Image, X As Double, Y As Double)
Creates a new ImageInput with the specified source, X and Y.
X and Y are in the coordinate space of the node. To take the camera position into account, subtract sgeCamera.LeftX from X and sgeCamera.TopY from Y.
Properties:
- Source As Image
Gets or sets the source image.
- X As Double
Gets or sets the X location of the source image.
X is in the coordinate space of the node. To take the camera position into account, subtract sgeCamera.LeftX from X.
- Y As Double
Gets or sets the Y location of the source image.
Y is in the coordinate space of the node. To take the camera position into account, subtract sgeCamera.TopY from Y.
sgeEffectInnerShadow
Fields:
- BLURTYPE_GAUSSIAN As javafx.scene.effect.BlurType
- BLURTYPE_ONE_PASS_BOX As javafx.scene.effect.BlurType
- BLURTYPE_THREE_PASS_BOX As javafx.scene.effect.BlurType
- BLURTYPE_TWO_PASS_BOX As javafx.scene.effect.BlurType
Functions:
- Initialize
Creates a new InnerShadow effect with default parameters.
- Initialize2 (Radius As Double, Color As javafx.scene.paint.Color)
Creates a new InnerShadow effect with the specified radius and color.
- Initialize3 (Radius As Double, OffsetX As Double, OffsetY As Double, Color As javafx.scene.paint.Color)
Creates a new InnerShadow effect with the specified radius, offsetX, offsetY and color.
Properties:
- BlurType As javafx.scene.effect.BlurType
Gets or sets the algorithm used to blur the shadow (one of the BLURTYPE_... constants).
- Choke As Double
Gets or sets the choke of the shadow. From 0 to 1.
The choke is the portion of the radius where the contribution of the source material will be 100%. The remaining portion of the radius will have a contribution controlled by the blur kernel.
- Color As javafx.scene.paint.Color
Gets or sets the shadow color.
- Height As Double
Gets or sets the vertical size of the shadow blur kernel. From 0 to 255.
- OffsetX As Double
Gets or sets the shadow offset in the X direction, in pixels.
- OffsetY As Double
Gets or sets the shadow offset in the Y direction, in pixels.
- Radius As Double
Gets or sets the radius of the shadow blur kernel. From 0 to 127.
- Width As Double
Gets or sets the horizontal size of the shadow blur kernel. From 0 to 255.
sgeEffectLightingDistant
Functions:
- Initialize
Creates a new LightingDistant effect with default parameters.
- Initialize2 (Azimuth As Double, Elevation As Double, Color As javafx.scene.paint.Color)
Creates a new LightingDistant effect with the specified azimuth, elevation, and color.
Properties:
- Azimuth As Double
Gets or sets the azimuth of the light. The azimuth is the direction angle for the light source on the XY plane, in degrees.
- Color As javafx.scene.paint.Color
Gets or sets the color of the light source.
- DiffuseConstant As Double
Gets or sets the diffuse constant. From 0 to 2.
- Elevation As Double
Gets or sets the elevation of the light. The elevation is the direction angle for the light source on the YZ plane, in degrees.
- SpecularConstant As Double
Gets or sets the specular constant. From 0 to 2.
- SpecularExponent As Double
Gets or sets the specular exponent. From 0 to 40.
- SurfaceScale As Double
Gets or sets the surface scale factor. From 0 to 10.
sgeEffectLightingPoint
Functions:
- Initialize
Creates a new LightingPoint effect with default parameters.
- Initialize2 (X As Double, Y As Double, Z As Double, Color As javafx.scene.paint.Color)
Creates a new LightingPoint effect with the specified X, Y, Z, and color.
X: The X coordinate of the light position.
Y: The Y coordinate of the light position.
Z: The Z coordinate of the light position.
Properties:
- Color As javafx.scene.paint.Color
Gets or sets the color of the light source.
- DiffuseConstant As Double
Gets or sets the diffuse constant. From 0 to 2.
- SpecularConstant As Double
Gets or sets the specular constant. From 0 to 2.
- SpecularExponent As Double
Gets or sets the specular exponent. From 0 to 40.
- SurfaceScale As Double
Gets or sets the surface scale factor. From 0 to 10.
- X As Double
Gets or sets the X coordinate of the light position.
- Y As Double
Gets or sets the Y coordinate of the light position.
- Z As Double
Gets or sets the Z coordinate of the light position.
sgeEffectLightingSpot
Functions:
- Initialize
Creates a new LightingSpot effect with default parameters.
- Initialize2 (X As Double, Y As Double, Z As Double, SpecularExponent As Double, Color As javafx.scene.paint.Color)
Creates a new LightingSpot effect with the specified X, Y, Z, specular exponent, and color.
X: The X coordinate of the direction vector for this light.
Y: The Y coordinate of the direction vector for this light.
Z: The Z coordinate of the direction vector for this light.
SpecularExponent: The specular exponent, which controls the focus of this light source.
Properties:
- Color As javafx.scene.paint.Color
Gets or sets the color of the light source.
- DiffuseConstant As Double
Gets or sets the diffuse constant. From 0 to 2.
- SpecularConstant As Double
Gets or sets the specular constant. From 0 to 2.
- SpecularExponent As Double
Gets or sets the specular exponent, which controls the focus of this light source. From 0 to 4.
- SurfaceScale As Double
Gets or sets the surface scale factor. From 0 to 10.
- X As Double
Gets or sets the X coordinate of the direction vector for this light.
- Y As Double
Gets or sets the Y coordinate of the direction vector for this light.
- Z As Double
Gets or sets the Z coordinate of the direction vector for this light.
sgeEffectMotionBlur
Functions:
- Initialize
Creates a new MotionBlur effect with default parameters.
- Initialize2 (Angle As Double, Radius As Double)
Creates a new MotionBlur effect with the specified angle and radius.
Properties:
- Angle As Double
Gets or sets the angle of the motion effect, in degrees.
- Radius As Double
Gets or sets the radius of the blur kernel. From 0 to 63.
sgeEffectPerspectiveTransform
Functions:
- Initialize
Creates a new PerspectiveTransform effect with default parameters.
- Initialize2 (ulx As Double, uly As Double, urx As Double, ury As Double, lrx As Double, lry As Double, llx As Double, lly As Double)
Creates a new PerspectiveTransform effect with the specified ulx, uly, urx, ury, lrx, lry, llx, and lly.
Properties:
- Llx As Double
Gets or sets the X coordinate of the output location onto which the lower left corner of the source is mapped.
- Lly As Double
Gets or sets the Y coordinate of the output location onto which the lower left corner of the source is mapped.
- Lrx As Double
Gets or sets the X coordinate of the output location onto which the lower right corner of the source is mapped.
- Lry As Double
Gets or sets the Y coordinate of the output location onto which the lower right corner of the source is mapped.
- Ulx As Double
Gets or sets the X coordinate of the output location onto which the upper left corner of the source is mapped.
- Uly As Double
Gets or sets the Y coordinate of the output location onto which the upper left corner of the source is mapped.
- Urx As Double
Gets or sets the X coordinate of the output location onto which the upper right corner of the source is mapped.
- Ury As Double
Gets or sets the Y coordinate of the output location onto which the upper right corner of the source is mapped.
sgeEffectReflection
Functions:
- Initialize
Creates a new Reflection effect with default parameters.
- Initialize2 (TopOffset As Double, Fraction As Double, TopOpacity As Double, BottomOpacity As Double)
Creates a new Reflection effect with the specified top offset, fraction, top opacity and bottom opacity.
Properties:
- BottomOpacity As Double
Gets or sets the bottom opacity value, which is the opacity of the reflection at its bottom extreme. From 0 to 1.
- Fraction As Double
Gets or sets the fraction of the input that is visible in the reflection. From 0 to 1.
- TopOffset As Double
Gets or sets the top offset adjustment, which is the distance between the bottom of the input and the top of the reflection.
- TopOpacity As Double
Gets or sets the top opacity value, which is the opacity of the reflection at its top extreme. From 0 to 1.
sgeGraphics
Fields:
- CAP_BUTT As javafx.scene.shape.StrokeLineCap
- CAP_ROUND As javafx.scene.shape.StrokeLineCap
- CAP_SQUARE As javafx.scene.shape.StrokeLineCap
- CLOSURE_CHORD As javafx.scene.shape.ArcType
- CLOSURE_OPEN As javafx.scene.shape.ArcType
- CLOSURE_ROUND As javafx.scene.shape.ArcType
- FONT_SMOOTHING_GRAY As javafx.scene.text.FontSmoothingType
- FONT_SMOOTHING_LCD As javafx.scene.text.FontSmoothingType
- JOIN_BEVEL As javafx.scene.shape.StrokeLineJoin
- JOIN_MITER As javafx.scene.shape.StrokeLineJoin
- JOIN_ROUND As javafx.scene.shape.StrokeLineJoin
- TEXT_ALIGNMENT_CENTER As javafx.scene.text.TextAlignment
- TEXT_ALIGNMENT_LEFT As javafx.scene.text.TextAlignment
- TEXT_ALIGNMENT_RIGHT As javafx.scene.text.TextAlignment
Functions:
- ApplyTransform (T As javafx.scene.transform.Transform)
Applies the given Transform to the canvas.
- ApplyTransform2 (T1 As javafx.scene.transform.Transform, T2 As javafx.scene.transform.Transform)
Concatenates and applies the given Transforms.
- Clear
Clears the canvas with a transparent color value.
- Clear2 (Color As javafx.scene.paint.Paint)
Clears the canvas with the specified color value.
- ConcatenateTransforms (T1 As javafx.scene.transform.Transform, T2 As javafx.scene.transform.Transform) As javafx.scene.transform.Transform
Concatenates the given Transforms.
- CreatePath As sgePath
Creates a sgePath object. Path commands should follow the call to this function.
- DrawArc (X As Double, Y As Double, Width As Double, Height As Double, StartAngle As Double, ArcExtent As Double, Closure As javafx.scene.shape.ArcType, Filled As Boolean)
Draws an arc using the current fill paint color if Filled is true, or the current stroke paint color and line attributes otherwise.
StartAngle: The starting angle of the arc in degrees.
ArcExtent: The angular extent of the arc in degrees.
Closure: One of the CLOSURE_... constants.
- DrawBox (Box As sgeBoundingBox, Filled As Boolean)
Draws the given bounding box using the current fill paint color if Filled is true, or the current stroke paint color and line attributes otherwise.
- DrawCircle (CenterX As Double, CenterY As Double, Radius As Double, Filled As Boolean)
Draws a circle using the current fill paint color if Filled is true, or the current stroke paint color and line attributes otherwise.
- DrawCircle2 (Circle As sgeCircle, Filled As Boolean)
Draws the given circle using the current fill paint color if Filled is true, or the current stroke paint color and line attributes otherwise.
- DrawImage (Image As Image, X As Double, Y As Double)
Draws an image at the given X,Y position using the width and height of the given image.
- DrawImage2 (Image As Image, X As Double, Y As Double, Width As Double, Height As Double)
Draws an image into the given destination rectangle of the canvas. The image is scaled to fit into the destination rectangle.
- DrawLine (X1 As Double, Y1 As Double, X2 As Double, Y2 As Double)
Draws a line using the current stroke paint color and line attributes.
- DrawNinePatch (NinePatch As sgeRegion(,), X As Double, Y As Double, Width As Double, Height As Double)
Draws a 9-patch image (3x3 regions) at the given X,Y position. The central regions are stretched so the 9-patch image fits into the destination rectangle.
- DrawNinePatch2 (NinePatch As sgeNinePatch, X As Double, Y As Double, Width As Double, Height As Double)
Draws the specified NinePatch at the given X,Y position. The central regions are stretched so the 9-patch image fits into the destination rectangle.
- DrawOval (X As Double, Y As Double, Width As Double, Height As Double, Filled As Boolean)
Draws an oval using the current fill paint color if Filled is true, or the current stroke paint color and line attributes otherwise.
- DrawPixel (X As Int, Y As Int, Color As javafx.scene.paint.Paint)
Draws a pixel at the given X,Y position with the specified color.
- DrawPolygon (Point2Ds As List, Filled As Boolean)
Draws a polygon using the current fill paint color if Filled is true, or the current stroke paint color and line attributes otherwise.
Point2Ds: List of sgePoint2D objects containing the coordinates of the polygon's points.
- DrawPolygon2 (Point2Ds As sgePoint2D(), Filled As Boolean)
Draws a polygon using the current fill paint color if Filled is true, or the current stroke paint color and line attributes otherwise.
Point2Ds: Array of sgePoint2D objects containing the coordinates of the polygon's points.
- DrawPolygon3 (xPoints As Double(), yPoints As Double(), nPoints As Int, Filled As Boolean)
Draws a polygon using the current fill paint color if Filled is true, or the current stroke paint color and line attributes otherwise.
xPoints: Array containing the X coordinates of the polygon's points.
yPoints: Array containing the Y coordinates of the polygon's points.
nPoints: The number of points that make the polygon.
- DrawPolygon4 (Polygon As sgePolygon, Filled As Boolean)
Draws the given polygon using the current fill paint color if Filled is true, or the current stroke paint color and line attributes otherwise.
- DrawPolyline (Point2Ds As List)
Draws a polyline using the current stroke paint color and line attributes.
Point2Ds: List of sgePoint2D objects containing the coordinates of the polyline's points.
- DrawPolyline2 (Point2Ds As sgePoint2D())
Draws a polyline using the current stroke paint color and line attributes.
Point2Ds: Array of sgePoint2D objects containing the coordinates of the polyline's points.
- DrawPolyline3 (xPoints As Double(), yPoints As Double(), nPoints As Int)
Draws a polyline using the current stroke paint color and line attributes.
xPoints: Array containing the X coordinates of the polyline's points.
yPoints: Array containing the Y coordinates of the polyline's points.
nPoints: The number of points that make the polyline.
- DrawRect (X As Double, Y As Double, Width As Double, Height As Double, Filled As Boolean)
Draws a rectangle using the current fill paint color if Filled is true, or the current stroke paint color and line attributes otherwise.
- DrawRegion (Region As sgeRegion, X As Double, Y As Double)
Draws a region at the given X,Y position using the width and height of the given region.
- DrawRegion2 (Region As sgeRegion, X As Double, Y As Double, Width As Double, Height As Double)
Draws the specified region into the given destination rectangle of the canvas.
- DrawRoundRect (X As Double, Y As Double, Width As Double, Height As Double, ArcWidth As Double, ArcHeight As Double, Filled As Boolean)
Draws a rounded rectangle using the current fill paint color if Filled is true, or the current stroke paint color and line attributes otherwise.
ArcWidth,ArcHeight: The arc dimensions of the rectangle corners.
- DrawSegment (Segment As sgeSegment)
Draws the given segment using the current stroke paint color and line attributes.
- DrawString (Text As String, X As Double, Y As Double, Filled As Boolean)
Draws the given string of text at position X,Y with the current fill paint color if Filled is true, or the current stroke paint color and line attributes otherwise.
- DrawString2 (Text As String, X As Double, Y As Double, Filled As Boolean, MaxWidth As Int)
Draws the given string of text at position X,Y with the current fill paint color if Filled is true, or the current stroke paint color and line attributes otherwise.
MaxWidth: If the width of the text extends past this value, then it will be sized to fit.
- DrawText (Text As sgeText, X As Double, Y As Double)
Draws the specified Text object at position X,Y. This may change the font and color attributes.
- DrawTiledMap (Map As sgeTiledMap)
Draws the given tiled map.
- DrawTiledMap2 (Map As sgeTiledMap, X As Double, Y As Double)
Draws the given tiled map at the specified position.
- DrawTiledMapImageLayer (TiledMap As sgeTiledMap, LayerName As String)
Draws the image layer with the given name.
- DrawTiledMapLayer (Layer As flm.b4j.simplegameengine.tiledmap.AbstractLayer)
Draws the specified map layer.
- DrawTiledMapLayer2 (Layer As flm.b4j.simplegameengine.tiledmap.AbstractLayer, X As Double, Y As Double)
Draws the specified map layer at the given position.
- DrawTiledMapTileLayer (TiledMap As sgeTiledMap, LayerName As String)
Draws the tile layer with the given name.
- FillWithImage (Image As Image)
Fills the canvas with the given image. The image is repeated horizontally and vertically.
- FillWithRegion (Region As sgeRegion)
Fills the canvas with the given region. The region is repeated horizontally and vertically.
- IsTransformed As Boolean
Returns whether the canvas is rotated, scaled or sheared with a Transform (the camera zoom is not taken into account).
- RestoreState
Pops the state off of the stack, setting the following attributes to their value at the time when that state was pushed onto the stack with SaveState. If the stack is empty then nothing is changed.
- CurrentTransform
- Effect
- Fill
- Font
- GlobalAlpha
- LineCap
- LineDashes
- LineJoin
- LineWidth
- Stroke
- TextAlignment
- Rotate (Degrees As Double) As javafx.scene.transform.Transform
Returns a Transform object representing a rotating transformation.
- Rotate2 (Degrees As Double, PivotX As Double, PivotY As Double) As javafx.scene.transform.Transform
Returns a Transform object representing a rotating transformation around the given pivot point.
- SaveState
Saves the following attributes onto a stack:
- CurrentTransform
- Effect
- Fill
- Font
- GlobalAlpha
- LineCap
- LineDashes
- LineJoin
- LineWidth
- Stroke
- TextAlignment
- Scale (X As Double, Y As Double) As javafx.scene.transform.Transform
Returns a Transform object representing a scaling transformation.
X: Factor by which coordinates are scaled along the X axis direction.
Y: Factor by which coordinates are scaled along the Y axis direction.
- Scale2 (X As Double, Y As Double, PivotX As Double, PivotY As Double) As javafx.scene.transform.Transform
Returns a Transform object representing a scaling transformation.
X: Factor by which coordinates are scaled along the X axis direction.
Y: Factor by which coordinates are scaled along the Y axis direction.
PivotX: The X coordinate about which point the scale occurs.
PivotY: The Y coordinate about which point the scale occurs.
- Shear (X As Double, Y As Double) As javafx.scene.transform.Transform
Returns a Transform object representing a shearing transformation.
X: Multiplier by which coordinates are shifted in the direction of the positive X axis as a factor of their Y coordinate.
Y: Multiplier by which coordinates are shifted in the direction of the positive Y axis as a factor of their X coordinate.
- Shear2 (X As Double, Y As Double, PivotX As Double, PivotY As Double) As javafx.scene.transform.Transform
Returns a Transform object representing a shearing transformation.
X: Multiplier by which coordinates are shifted in the direction of the positive X axis as a factor of their Y coordinate.
Y: Multiplier by which coordinates are shifted in the direction of the positive Y axis as a factor of their X coordinate.
PivotX: The X coordinate of the shear pivot point.
PivotY: The Y coordinate of the shear pivot point.
Properties:
- CurrentTransform As javafx.scene.transform.Transform [read only]
Returns a copy of the current Transform applied to the canvas.
- Effect As flm.b4j.simplegameengine.effects.AbstractEffect [write only]
Sets the effect to be applied. Note that effects are not cumulative.
- Fill As javafx.scene.paint.Paint
Gets or sets the current fill paint color. The default value is fx.Colors.Black.
- Font As javafx.scene.text.Font
Gets or sets the current font.
- FontSmoothingType As javafx.scene.text.FontSmoothingType
Gets or sets the current font smoothing type. The default value is FONT_SMOOTHING_GRAY.
This setting is taken into account only if "#LcdFontSmoothing: True" is added to the project attributes.
- GlobalAlpha As Double
Gets or sets the global alpha of the current state (a value from 0 to 1). The default value is 1.0.
- LineCap As javafx.scene.shape.StrokeLineCap
Gets or sets the current stroke line cap. The default value is CAP_SQUARE.
- LineDashes As Double()
Gets or sets the current stroke line dash pattern. The default value is Null.
- LineJoin As javafx.scene.shape.StrokeLineJoin
Gets or sets the current stroke line join. The default value is JOIN_MITER.
- LineWidth As Double
Gets or sets the current line width. The default value is 1.0.
- Stroke As javafx.scene.paint.Paint
Gets or sets the current stroke paint color. The default value is fx.Colors.Black.
- TextAlignment As javafx.scene.text.TextAlignment
Gets or sets the horizontal text alignment, relative to the X position.
sgeGroup
Events:
- ActionEnd
- ActionProgression (Progression As Double, Data As Object)
Fields:
- FIND_ALL As Byte
- FIND_ONLY_ACTORS As Byte
- FIND_ONLY_GROUPS As Byte
- REPEAT_FOREVER As Int
Functions:
- Clear
Removes all actors from this group.
- ClearActions
Clears all actions of this actor. The actions in progress are cancelled.
- ClearClipBounds
Cancels the clipping set with SetClipBounds.
- DebugDraw (InvisibleGroupColor As javafx.scene.paint.Color, VisibleGroupColor As javafx.scene.paint.Color, InvisibleActorColor As javafx.scene.paint.Color, VisibleActorColor As javafx.scene.paint.Color, LineWidth As Int)
Draws the visual object of all visible actors within this group. Draws also a rectangle around all actors and groups for debugging purposes.
- Draw
Draws the visual object of all visible actors within this group.
- FindAtPos (Pos As sgePoint2D) As List
Returns the list of actors inside this group whose bounds contain the given position. The list is sorted by Z-order (highest values first).
- FindAtPos2 (Pos As sgePoint2D, TypeLimitation As Byte, OnlyVisible As Boolean, TransformedBB As Boolean) As List
Returns the list of actors inside this group whose bounds contain the given position. The list is sorted by Z-order (highest values first) and can be filtered by the specified parameters.
TypeLimitation: Whether the list has to be restricted to groups or actors (one of the FIND_... constants).
OnlyVisible: Whether the list has to be restricted to visible groups/actors.
TransformedBB: Whether the bounding box to be checked should take into account drawing offsets, rotation angle and scales.
- Initialize (Parent As sgeGroup, EventPrefix As String)
Creates a group that can contain actors.
- IsInitialized As Boolean
- PerformAction (ElapsedInMillis As Long)
Updates the data of the action assigned to this actor. Should be called in the Update event.
- PerformChildrenActions (ElapsedInMillis As Long) As Boolean
Updates the data of the children of this group having an action set. Should be called in the Update event.
Returns True if a child with an action in progress was found.
- RemoveFromParent
Removes this group from its parent group and destroys the visual object of all children actors.
- SetClipBounds (LocalX As Double, LocalY As Double, Width As Double, Height As Double)
When set, limits the rendering of this group to within the bounds of a rectangle. Note that the Width and Height values added to LocalX and LocalY cannot be greater than the group dimensions.
- SetLocalPosition (X As Double, Y As Double)
Sets the local position of this actor. The LocalX,LocalY coordinates are relative to the parent's coordinates.
- SetPosition (X As Double, Y As Double)
Sets the global position of this actor. The X,Y coordinates are relative to the canvas origin.
- SetRepeatedAction (Action As sgeAction, Count As Int)
Repeats the specified action the given number of times (or forever if Count is set to REPEAT_FOREVER). This action is repeated only after all actions linked with Then and With are finished.
- SetScale (Scale As Double)
Gets or sets the scale of this actor in both directions.
Properties:
- Action As sgeAction
Gets or sets the action to be performed.
- ActorWaitingSynchronization As flm.b4j.simplegameengine.actors.AbstractActor [read only]
Returns the actor sending a synchronization signal and waiting for this actor to do the same.
- Alpha As Double
Gets or sets the opacity value of this actor.
- BoundingBox As sgeBoundingBox [read only]
Returns the bounding box containing this actor.
- BoundingBox2 As sgeBoundingBox [read only]
Returns the bounding box containing this actor, taking into account drawing offsets, rotation angle and scales.
- CenterX As Double [read only]
- CenterY As Double [read only]
- Children As List [read only]
Returns a list of all actors within this group. It's a copy so adding or removing items has no consequence on the original list.
- Effect As flm.b4j.simplegameengine.effects.AbstractEffect
Gets or sets the effect applied to this actor. Note that effects are not cumulative. So any effect applied to a group will be ignored by an actor of this group having its own effect.
- FlipX As Boolean
Gets or sets whether this actor is flipped on the X axis.
- FlipY As Boolean
Gets or sets whether this actor is flipped on the Y axis.
- Height As Double [read only]
Gets the height of this group. This height is computed according to the group content.
- LocalCenterX As Double [read only]
- LocalCenterY As Double [read only]
- LocalX As Double
Gets or sets the local X position of this actor. The LocalX,LocalY coordinates are relative to the parent's coordinates.
- LocalY As Double
Gets or sets the local Y position of this actor. The LocalX,LocalY coordinates are relative to the parent's coordinates.
- Parent As sgeGroup
Gets or sets the group containing this actor.
- RotateAroundCenter As Boolean
Gets or sets whether the rotation is done around the center (true) or around the origin (false).
- Rotation As Double
Gets or sets the rotation angle in degrees.
- ScaleX As Double
Gets or sets the scale of this actor in the horizontal direction relative to its width.
- ScaleY As Double
Gets or sets the scale of this actor in the vertical direction relative to its height.
- Tag As Object
- Visible As Boolean
Gets or sets whether this actor is shown or hidden.
- Width As Double [read only]
Gets the width of this group. This width is computed according to the group content.
- X As Double
Gets or sets the global X position. The X,Y coordinates are relative to the canvas origin.
- Y As Double
Gets or sets the global Y position. The X,Y coordinates are relative to the canvas origin.
- ZOrder As Int
Gets or sets the Z-order (position in the drawing list of the actor's parent). 0 = first actor to be drawn.
sgeInput
Events:
- KeyPressed (KeyData As SgeKeyEvent)
- KeyReleased (KeyData As SgeKeyEvent)
- KeyTyped (UnicodeCharacter As String)
- MouseClicked (EventData As MouseEvent)
- MouseDragged (EventData As MouseEvent)
- MouseEntered (EventData As MouseEvent)
- MouseExited (EventData As MouseEvent)
- MouseMoved (EventData As MouseEvent)
- MousePressed (EventData As MouseEvent)
- MouseReleased (EventData As MouseEvent)
- Scroll (DeltaY As Double)
Fields:
- ASCII_BACK_SPACE As Int
- ASCII_DELETE As Int
- ASCII_ENTER As Int
- ASCII_ESCAPE As Int
- ASCII_TAB As Int
Functions:
- ClipMousePosition (Clip As Boolean)
If Clip is True, LatestMouseX and LatestMouseY will return -1 when the mouse is outside the node bounds. Default = False.
- IsAltKeyDown As Boolean
- IsControlKeyDown As Boolean
- IsMiddleButtonDown As Boolean
Returns True if the middle mouse button is currently pushed down.
- IsPrimaryButtonDown As Boolean
Returns True if the primary mouse button (usually the left) is currently pushed down.
- IsSecondaryButtonDown As Boolean
Returns True if the secondary mouse button (usually the right) is currently pushed down.
- IsShiftKeyDown As Boolean
- MouseToCanvas (X As Double, Y As Double) As sgePoint2D
Transforms the given mouse position from its coordinate space into the coordinate space of the canvas.
- MouseToParent (X As Double, Y As Double) As sgePoint2D
Transforms the given mouse position from its coordinate space into the coordinate space of the node parent.
Properties:
- LatestMouseX As Double [read only]
Returns the most recent horizontal position of the mouse.
- LatestMouseY As Double [read only]
Returns the most recent vertical position of the mouse.
- LatestPressedKey As sgeKeyEvent [read only]
Returns the most recent pressed key.
- PressedKeys As List [read only]
Returns a list containing all currently pressed keys as sgeKeyEvent objects.
sgeInterpolators
Events:
- Interpolate (Value As Double) As Double
Functions:
- Custom (EventPrefix As String) As javafx.animation.Interpolator
Allows to create your own interpolator. The Interpolate event is raised over time and has to return a value between 0 and 1.
- Ease_Both As javafx.animation.Interpolator
The Ease-Both interpolator will make an animation start slow, then accelerate and slow down again towards the end, all in a smooth manner.
- Ease_In As javafx.animation.Interpolator
The Ease-In interpolator will make an animation start slow and then accelerate smoothly.
- Ease_Out As javafx.animation.Interpolator
The Ease-Out interpolator will make an animation slow down toward the end smoothly.
- Exp_Both (Power As Int) As javafx.animation.Interpolator
The Exp-Both interpolator will make an animation start slow, then accelerate and slow down again towards the end, all in an exponential manner.
- Exp_In (Power As Int) As javafx.animation.Interpolator
The Exp-In interpolator will make an animation start slow and then accelerate exponentially.
- Exp_Out (Power As Int) As javafx.animation.Interpolator
The Exp-Out interpolator will make an animation start fast and then slow down exponentially.
- Linear As javafx.animation.Interpolator
Provides a linear time interpolation.
- Sine_Both As javafx.animation.Interpolator
The Sine-Both interpolator will make an animation start slow, then accelerate and slow down again towards the end, all in a smooth manner.
- Sine_In As javafx.animation.Interpolator
The Sine-In interpolator will make an animation start slow and then accelerate smoothly.
- Sine_Out As javafx.animation.Interpolator
The Sine-Out interpolator will make an animation slow down toward the end smoothly.
sgeIntersections
Functions:
- BoxAndBox (Box1 As sgeBoundingBox, Box2 As sgeBoundingBox) As Boolean
Tests if the given bounding boxes intersect.
- BoxAndCircle (Box As sgeBoundingBox, Circle As sgeCircle) As Boolean
Tests if the given bounding box intersects the given circle.
- BoxAndPolygon (Box As sgeBoundingBox, Polygon As sgePolygon) As Boolean
Tests if the given bounding box intersects the given polygon.
- BoxAndRect (Box As sgeBoundingBox, RectX As Double, RectY As Double, RectWidth As Double, RectHeight As Double) As Boolean
Tests if the given bounding box intersects the given rectangle.
- BoxAndSegment (Box As sgeBoundingBox, Segment As sgeSegment) As Boolean
Tests if the given bounding box intersects the given segment.
- CircleAndCircle (Circle1 As sgeCircle, Circle2 As sgeCircle) As Boolean
Tests if the given circles intersect.
- CircleAndPolygon (Circle As sgeCircle, Polygon As sgePolygon) As Boolean
Tests if the given circle intersects the given polygon.
- CircleAndRect (Circle As sgeCircle, RectX As Double, RectY As Double, RectWidth As Double, RectHeight As Double) As Boolean
Tests if the given circle intersects the given rectangle.
- CircleAndSegment (Circle As sgeCircle, Segment As sgeSegment) As Boolean
Tests if the given circle intersects the given segment.
- CircleAndSegment2 (Circle As sgeCircle, X1 As Double, Y1 As Double, X2 As Double, Y2 As Double) As Boolean
Tests if the given circle intersects the given segment.
- PolygonAndPolygon (Polygon1 As sgePolygon, Polygon2 As sgePolygon) As Boolean
Tests if the given polygons intersect.
- PolygonAndSegment (Polygon As sgePolygon, Segment As sgeSegment) As Boolean
Tests if the given polygon intersects the given segment.
- SegmentAndRect (Segment As sgeSegment, RectX As Int, RectY As Int, RectWidth As Int, RectHeight As Int) As Boolean
Tests if the given segment intersects the given rectangle.
- SegmentAndSegment (Segment1 As sgeSegment, Segment2 As sgeSegment) As Boolean
Tests if the given segments intersect.
sgeKeyEvent
Fields:
- KEY_ALT As String
- KEY_ALT_GRAPH As String
- KEY_BACK_SPACE As String
- KEY_CONTEXT_MENU As String
- KEY_CONTROL As String
- KEY_DELETE As String
- KEY_DOWN As String
- KEY_END As String
- KEY_ENTER As String
- KEY_ESCAPE As String
- KEY_HOME As String
- KEY_INSERT As String
- KEY_LEFT As String
- KEY_PAGE_DOWN As String
- KEY_PAGE_UP As String
- KEY_RIGHT As String
- KEY_SHIFT As String
- KEY_SPACE As String
- KEY_TAB As String
- KEY_UP As String
Functions:
- IsArrowKey As Boolean
Returns True if this key is the left, right, up or down key (including the keypad arrows).
- IsFunctionKey As Boolean
Returns True if the code of this key corresponds to a functional key (e.g. F10).
- IsKeypadKey As Boolean
Returns True if the code of this key corresponds to a key on the keypad.
- IsMediaKey As Boolean
Returns True if the code of this key corresponds to a media key (e.g. volume control key).
- IsModifierKey As Boolean
Returns True if this key could act as a modifier (e.g. Alt, Control, Shift).
- toString As String
Returns a textual representation of this key event.
Properties:
- Code As String [read only]
Returns the code of this key.
sgeMapCell
Fields:
- ROTATION_270 As Byte
- ROTATION_90 As Byte
- ROTATION_NONE As Byte
Functions:
Properties:
- FlipX As Boolean
Gets or sets whether the tile of this cell is horizontally flipped when drawn.
- FlipY As Boolean
Gets or sets whether the tile of this cell is vertically flipped when drawn.
- Rotation As Byte
Gets or sets the rotation of this cell (either ROTATION_NONE, ROTATION_90 or ROTATION_270).
- Tag As Object
- Tile As sgeMapTile
Gets or sets the tile used to draw the cell.
sgeMapTile
Functions:
- AddProperty (Name As String, Value As String)
Adds a custom property to this tile.
- GetProperty (Name As String) As String
Retrieves a custom property of this tile with the given name.
- toString As String
Properties:
- CollisionObjects As List [read only]
Returns the list of collision objects of this tile. It's a copy so adding or removing items has no consequence on the original list.
- Image As Image
Gets or sets the image of this tile. If an image is set, Region is Null.
- Properties As Map [read only]
Returns a Map containing all custom properties of this tile.
- Region As sgeRegion
Gets or sets the region of this tile. If a region is set, Image is Null.
- Tileset As sgeMapTileset [read only]
sgeMapTileset
Functions:
- AddProperty (Name As String, Value As String)
Adds a custom property to this tileset.
- GetProperty (Name As String) As String
Retrieves a custom property of this tileset with the given name.
- GetTile (id As Int) As sgeMapTile
Retrieves the tile with the given ID.
- toString As String
Properties:
- FirstGlobalID As Int [read only]
- ImageHeight As Int [read only]
- ImageSource As String [read only]
- ImageWidth As Int [read only]
- Margin As Int [read only]
- Name As String [read only]
- OffsetX As Int [read only]
- OffsetY As Int [read only]
- Properties As Map [read only]
Returns a Map containing all custom properties of this tileset.
- Source As String [read only]
- Spacing As Int [read only]
- TileHeight As Int [read only]
- Tiles As Map [read only]
Returns a Map containing all tiles of this tileset.
- TileWidth As Int [read only]
sgeMusic
Fields:
Functions:
- Initialize (Dir As String, Filename As String)
Creates a new music instance.
- IsInitialized As Boolean
- IsPaused As Boolean
Indicates whether the playback is paused.
- IsPlaying As Boolean
Indicates whether this music is playing.
- IsReady As Boolean
Indicates whether the player is prepared to play.
- Pause
Pauses the playback.
- Play
Starts playing the music. If previously paused, then playback resumes where it was paused.
- PlayFromStart
Starts playing the music from the beginning.
- Seek (SeekTime As Double)
Seeks the player to a new playback time (in milliseconds from start).
- Stop
Stops playing the music.
Properties:
- Balance As Double
Gets or sets the relative left and right volume levels of the music. Valid range is -1 to 1 where -1 gives full volume to the left channel while muting the right channel, 0 gives full volume to both channels and 1 gives full volume to right channel and mutes the left channel. Default = 0.
- CurrentTime As Double [read only]
Returns the current music playback time (in milliseconds from start).
- CycleCount As Int
Gets or sets the number of times the music will be played when Play is called. Setting this to CYCLE_INDEFINITE will cause the music to repeat until Pause or Stop is called. Default = 1.
- Duration As Double [read only]
Retrieves the duration in seconds of the music. This information is only available when the player is ready to play.
- Volume As Double
Gets or sets the volume at which the music should be played. Valid range is 0 (inaudible) to 1 (full volume). Default = 1.
sgeNavigationGrid
Fields:
- COST_IMPASSABLE As Float
- COST_NONE As Float
- COST_NORMAL As Float
Functions:
- AddDirectConnection (Cell1 As sgePoint2D, Cell2 As sgePoint2D, OneWay As Boolean)
Adds a direct connection between two distant cells. Allows to simulate a teleportation, a jump, a hidden passage, etc.
Creating a direct connection disables the heuristic of the pathfinding algorithm as the distance to the goal cannot be easily estimated.
OneWay: Whether travel is possible from Cell1 to Cell2, but not from Cell2 to Cell1.
- Clone As sgeNavigationGrid
Returns a copy of this grid. It is an expensive operation so don't call this function repeatedly.
- Export (Dir As String, FileName As String)
Exports this grid to the specified text file. The saved file can be imported with the sgeAssetManager class.
- GetCost (Col As Int, Row As Int) As Float
Gets the cost for the cell at the given coordinates. From 0 (no obstacle, fastest move) to 10 (impassable obstacle, impossible move).
- GetDirectConnection (Col As Int, Row As Int) As sgePoint2D
Returns the coordinates of the cell connected directly to the cell at the given coordinates, or Null if there's no connection.
- GetTag (Col As Int, Row As Int) As Object
Gets the Tag value for the cell at the given coordinates.
- Initialize (WorldWidth As Int, WorldHeight As Int, CellSize As Int, CostsArray As Float(,), DiagonalMove As Boolean)
Divides the game world in square cells of the given size to create a navigation grid. The bigger are the cells, the faster is the pathfinding calculation, but also less accurate is the path.
Each cell has a navigation cost (the cost to enter the cell), which allows to simulate varying terrain difficulties.
WorldWidth,WorldHeight: The world size in pixels.
CellSize: The size of each cell in pixels.
CostsArray: An optional two-dimensional array (column, row) containing the navigation cost of each cell, which ranges from 1 (no obstacle, fast move) to 10 (impassable obstacle, impossible move). If CostsArray is Null, the default cost (1.0) is used.
DiagonalMove: Whether each cell is connected to the 8 surrounding cells (allowing diagonal moves) or just 4 cells (allowing only orthogonal moves).
- IsInitialized As Boolean
- SetCost (Col As Int, Row As Int, Cost As Float)
Sets the cost for the cell at the given coordinates. From 0 (no obstacle, fastest move) to 10 (impassable obstacle, impossible move).
- SetTag (Col As Int, Row As Int, Value As Object)
Sets the Tag value for the cell at the given coordinates.
- toString As String
Properties:
- CellSize As Int [read only]
Returns the size in pixels of the grid cells.
- NbOfCols As Int [read only]
Returns the number of columns of this grid.
- NbOfRows As Int [read only]
Returns the number of rows of this grid.
sgeNavigatorAStar
Events:
- Cost (C As Int, R As Int, NeighborC As Int, NeighborR As Int, Diagonal As Boolean, GridCost As Float) As Float
- Heuristic (C As Int, R As Int, StartC As Int, StartR As Int, GoalC As Int, GoalR As Int) As Float
- Path (LWP As List, ExceptionMsg As String, Tag As Object)
Fields:
- COST_CUSTOM As Byte
- COST_GRID_DIAG_DOUBLE As Byte
The cost to move diagonally is increased by 2.
- COST_GRID_DIAG_SAME As Byte
The cost to move diagonally is not increased.
- COST_GRID_DIAG_SQRT As Byte
The cost to move diagonally is increased by sqrt(2), i.e. 1.414. Should be the default in most cases.
- HEURISTIC_CHEBYSHEV As Byte
- HEURISTIC_CUSTOM As Byte
- HEURISTIC_DIAGONAL As Byte
- HEURISTIC_EUCLIDIAN As Byte
- HEURISTIC_MANHATTAN As Byte
Should be used only when diagonal moves are not allowed.
- HEURISTIC_NONE As Byte
Turns the A* algorithm into a Dijkstra algorithm.
Functions:
- CancelAll
Tries to cancel all path searches initiated by FindShortestPath or FindShortestPath_Async.
- CancelAsyncSearch (Tag As Object)
Tries to cancel a path search initiated by FindShortestPath_Async with the given Tag.
- FindShortestPath (Grid As sgeNavigationGrid, Position As sgePoint2D, Desired As sgePoint2D, Heuristic As Byte, Cost As Byte, EventPrefix As String) As List
Returns a list of waypoints defining the shortest path from the current position to a desired location, according to the specified A* heuristic.
This function returns Null if no path was found.
Grid: A navigation grid.
Heuristic: One of the methods (HEURISTIC_...) to estimate the movement cost between the considered cell and the final cell to reach.
Cost: One of the methods (COST_...) to compute the movement cost between two cells.
EventPrefix: Prefix of events. This function will fire a Heuristic event if you set Heuristic to Custom, and a Cost event if you set Cost to Custom.
- FindShortestPath_Async (Grid As sgeNavigationGrid, Position As sgePoint2D, Desired As sgePoint2D, Heuristic As Byte, Cost As Byte, Tag As Object, EventPrefix As String)
This function is identical to FindShortestPath except it runs on a background thread and fires a Path event when it ends.
If an exception occurs, the LWP parameter is null and the ExceptionMsg parameter contains the exception message.
Properties:
- TotalCost As Float [read only]
Returns the total cost of the last computed path, if a path was found.
Should be read right after the call to FindShortestPath if the result is not Null.
sgeNinePatch
Functions:
- Initialize (Regions As sgeRegion(,))
Creates a NinePatch object from an array of 3x3 regions.
First dimension = columns. Second dimension = rows.
- IsInitialized As Boolean
Properties:
- Array As sgeRegion(,)
- BottomLeftRegion As sgeRegion [read only]
- BottomMiddleRegion As sgeRegion [read only]
- BottomRightRegion As sgeRegion [read only]
- CentralColumnWidth As Double [read only]
- CentralRegion As sgeRegion [read only]
- CentralRowHeight As Double [read only]
- FirstColumnWidth As Double [read only]
- FirstRowHeight As Double [read only]
- LastColumnWidth As Double [read only]
- LastRowHeight As Double [read only]
- MiddleLeftRegion As sgeRegion [read only]
- MiddleRightRegion As sgeRegion [read only]
- MinHeight As Double [read only]
Returns the minimal height (the sum of all row heights) of this NinePatch.
- MinWidth As Double [read only]
Returns the minimal width (the sum of all column widths) of this NinePatch.
- TopLeftRegion As sgeRegion [read only]
- TopMiddleRegion As sgeRegion [read only]
- TopRightRegion As sgeRegion [read only]
sgePath
Fields:
- FILLRULE_EVEN_ODD As javafx.scene.shape.FillRule
- FILLRULE_NON_ZERO As javafx.scene.shape.FillRule
Functions:
- AppendSVGPath (SVGPath As String)
Appends an SVG Path string to the current path. An empty string or incorrect SVG path will be ignored.
- Arc (CenterX As Double, CenterY As Double, RadiusX As Double, RadiusY As Double, StartAngle As Double, Length As Double)
Adds path elements to the current path to make an arc that uses Euclidean degrees. This Euclidean orientation sweeps from East to North, then West, then South, then back to East.
CenterX: The center X position of the arc.
CenterY: The center Y position of the arc.
RadiusX: The X radius of the arc.
RadiusY: The Y radius of the arc.
StartAngle: The starting angle of the arc, ranging from 0 to 360.
Length: The length of the baseline of the arc.
- ArcTo (X1 As Double, Y1 As Double, X2 As Double, Y2 As Double, Radius As Double)
Adds segments to the current path to make an arc.
If p0 is the current point in the path and p1 is the point specified by (X1, Y1) and p2 is the point specified by (X2, Y2), then the arc segments appended will be segments along the circumference of a circle of the specified radius touching and inscribed into the convex (interior) side of p0->p1->p2. The path will contain a line segment (if needed) to the tangent point between that circle and p0->p1 followed by circular arc segments to reach the tangent point between the circle and p1->p2 and will end with the current point at that tangent point (not at p2).
- BezierCurveTo (Xc1 As Double, Yc1 As Double, Xc2 As Double, Yc2 As Double, Xend As Double, Yend As Double)
Adds segments to the current path to make a cubic Bezier curve.
Xc1,Yc1: The X,Y coordinates of the first Bezier control point.
Xc2,Yc2: The X,Y coordinates of the second Bezier control point.
Xend,Yend: The X,Y coordinates of the end point.
- Clip
Applies this path to subsequent rendering operation as an anti-aliased mask.
- Close
Closes the path.
- Draw (Filled As Boolean)
Fills the path with the current fill paint if Filled is True, otherwise strokes the path with the current stroke paint.
- IsPointInPath (P2D As sgePoint2D) As Boolean
Returns True if the the given point is inside the path.
- IsPointInPath2 (X As Double, Y As Double) As Boolean
Returns True if the the given X,Y point is inside the path.
- LineTo (X As Double, Y As Double)
Adds segments to the current path to make a line to the given X,Y coordinates.
- MoveTo (X As Double, Y As Double)
Issues a move command for the current path to the given X,Y coordinates.
- QuadraticCurveTo (Xc As Double, Yc As Double, Xend As Double, Yend As Double)
Adds segments to the current path to make a quadratic Bezier curve.
Xc,Yc: The X,Y coordinates of the control point.
Xend,Yend: The X,Y coordinates of the end point.
- Rect (X As Double, Y As Double, Width As Double, Height As Double)
Adds path elements to the current path to make a rectangle.
Properties:
- FillRule As javafx.scene.shape.FillRule
Gets or sets the filling rule attribute for determining the interior of paths in fill or clip operations. The default value is FILLRULE_NON_ZERO.
More details here: https://docs.oracle.com/javase/8/javafx/api/javafx/scene/shape/FillRule.html#enum.constant.detail
sgePoint2D
Functions:
- Add (X As Double, Y As Double) As sgePoint2D
Returns a point with the specified coordinates added to the coordinates of this point.
- Add2 (P2D As sgePoint2D) As sgePoint2D
Returns a point with the coordinates of the specified point added to the coordinates of this point.
- Angle As Double
Returns the angle (in degrees) of the vector represented by this point.
- AngleWithPoint (X As Double, Y As Double) As Double
Computes the angle (in degrees) between this point and the specified point.
- AngleWithPoint2 (P2D As sgePoint2D) As Double
Computes the angle (in degrees) between this point and the specified point.
- AngleWithVector (X As Double, Y As Double) As Double
Computes the angle (in degrees) between the vector represented by this point and the specified vector.
- AngleWithVector2 (P2D As sgePoint2D) As Double
Computes the angle (in degrees) between the vector represented by this point and the vector represented by the specified point.
- Distance (X As Double, Y As Double) As Double
Computes the distance between this point and the given point.
- Distance2 (P2D As sgePoint2D) As Double
Computes the distance between this point and the given point.
- DistanceSquared (X As Double, Y As Double) As Double
Computes the squared distance between this point and the given point.
- DistanceSquared2 (P2D As sgePoint2D) As Double
Computes the squared distance between this point and the given point.
- DotProduct (X As Double, Y As Double) As Double
Computes dot (scalar) product of the vector represented by this point and the specified vector.
- DotProduct2 (P2D As sgePoint2D) As Double
Computes dot (scalar) product of the vector represented by this point and the specified vector.
- Equals (P2D As sgePoint2D) As Boolean
Returns whether this point and the given point have the same coordinates.
- Initialize (X As Double, Y As Double)
Creates a new point with the given coordinates.
- IsInitialized As Boolean
- Magnitude As Double
Computes the magnitude (length) of the vector represented by this point.
- MidPoint (X As Double, Y As Double) As sgePoint2D
Returns a point which lies in the middle between this point and the specified coordinates.
- MidPoint2 (P2D As sgePoint2D) As sgePoint2D
Returns a point which lies in the middle between this point and the specified point.
- Multiply (Factor As Double) As sgePoint2D
Returns a point with the coordinates of this point multiplied by the specified factor.
- Negate As sgePoint2D
Returns the negation of the vector represented by this point.
- Normalize As sgePoint2D
Normalizes the relative magnitude vector represented by this point.
- Subtract (X As Double, Y As Double) As sgePoint2D
Returns a point with the specified coordinates subtracted from the coordinates of this point.
- Subtract2 (P2D As sgePoint2D) As sgePoint2D
Returns a point with the coordinates of the specified point subtracted from the coordinates of this point.
- toString As String
Properties:
- X As Double [read only]
Gets the X coordinate of this point.
- Y As Double [read only]
Gets the Y coordinate of this point.
sgePolygon
Functions:
- AddPoint (X As Int, Y As Int)
Appends the specified coordinates to this polygon.
- Contains (Point2D As sgePoint2D) As Boolean
Tests if the specified point is inside this polygon.
- Contains2 (X As Double, Y As Double) As Boolean
Tests if the specified point is inside this polygon.
- Initialize (Point2Ds As sgePoint2D())
Creates a polygon.
Point2Ds: Array of sgePoint2D objects containing the coordinates of the polygon's points.
- Initialize2 (xPoints As Int(), yPoints As Int(), nPoints As Int)
Creates a polygon.
xPoints: Array containing the X coordinates of the polygon's points.
yPoints: Array containing the Y coordinates of the polygon's points.
nPoints: The number of points that make the polygon.
- IsInitialized As Boolean
- MovePoint (Index As Int, X As Int, Y As Int)
Sets the new coordinates of the specified point. Index must be between 0 and the number of points - 1.
- Translate (deltaX As Int, deltaY As Int)
Translates the vertices of this polygon by deltaX along the X axis and by deltaY along the Y axis.
Properties:
- BoundingBox As sgeBoundingBox [read only]
Returns a bounding box that defines the bounds of this polygon.
- Centroid As sgePoint2D [read only]
Returns the centroid of this polygon.
- Points As sgePoint2D()
- Tag As Object
sgeRegion
Functions:
- Initialize (Image As Image, sourceX As Double, sourceY As Double, sourceWidth As Double, sourceHeight As Double)
Creates a new region. A region describes a rectangle inside an Image and is used for drawing only a portion of this image.
A region is not a cropped copy; if the source image is modified, the region is modified too.
- IsInitialized As Boolean
- toString As String
Properties:
- Height As Double
- Image As javafx.scene.image.Image
- Width As Double
- X As Double
- Y As Double
sgeRootGroup
Events:
- ActionEnd
- ActionProgression (Progression As Double, Data As Object)
Fields:
- FIND_ALL As Byte
- FIND_ONLY_ACTORS As Byte
- FIND_ONLY_GROUPS As Byte
- REPEAT_FOREVER As Int
Functions:
- Clear
Removes all actors from this group.
- ClearActions
Clears all actions of this actor. The actions in progress are cancelled.
- ClearClipBounds
Cancels the clipping set with SetClipBounds.
- DebugDraw (InvisibleGroupColor As javafx.scene.paint.Color, VisibleGroupColor As javafx.scene.paint.Color, InvisibleActorColor As javafx.scene.paint.Color, VisibleActorColor As javafx.scene.paint.Color, LineWidth As Int)
Draws the visual object of all visible actors within this group. Draws also a rectangle around all actors and groups for debugging purposes.
- Draw
Draws the visual object of all visible actors within this group.
- FindAtPos (Pos As sgePoint2D) As List
Returns the list of actors inside this group whose bounds contain the given position. The list is sorted by Z-order (highest values first).
- FindAtPos2 (Pos As sgePoint2D, TypeLimitation As Byte, OnlyVisible As Boolean, TransformedBB As Boolean) As List
Returns the list of actors inside this group whose bounds contain the given position. The list is sorted by Z-order (highest values first) and can be filtered by the specified parameters.
TypeLimitation: Whether the list has to be restricted to groups or actors (one of the FIND_... constants).
OnlyVisible: Whether the list has to be restricted to visible groups/actors.
TransformedBB: Whether the bounding box to be checked should take into account drawing offsets, rotation angle and scales.
- IsInitialized As Boolean
- PerformAction (ElapsedInMillis As Long)
Updates the data of the action assigned to this actor. Should be called in the Update event.
- PerformChildrenActions (ElapsedInMillis As Long) As Boolean
Updates the data of the children of this group having an action set. Should be called in the Update event.
Returns True if a child with an action in progress was found.
- SetClipBounds (LocalX As Double, LocalY As Double, Width As Double, Height As Double)
When set, limits the rendering of this group to within the bounds of a rectangle. Note that the Width and Height values added to LocalX and LocalY cannot be greater than the group dimensions.
- SetPosition (X As Double, Y As Double)
Sets the global position of this actor. The X,Y coordinates are relative to the canvas origin.
- SetRepeatedAction (Action As sgeAction, Count As Int)
Repeats the specified action the given number of times (or forever if Count is set to REPEAT_FOREVER). This action is repeated only after all actions linked with Then and With are finished.
- SetScale (Scale As Double)
Gets or sets the scale of this actor in both directions.
Properties:
- Action As sgeAction
Gets or sets the action to be performed.
- ActorWaitingSynchronization As flm.b4j.simplegameengine.actors.AbstractActor [read only]
Returns the actor sending a synchronization signal and waiting for this actor to do the same.
- Alpha As Double
Gets or sets the opacity value of this actor.
- BoundingBox As sgeBoundingBox [read only]
Returns the bounding box containing this actor.
- BoundingBox2 As sgeBoundingBox [read only]
Returns the bounding box containing this actor, taking into account drawing offsets, rotation angle and scales.
- CenterX As Double [read only]
- CenterY As Double [read only]
- Children As List [read only]
Returns a list of all actors within this group. It's a copy so adding or removing items has no consequence on the original list.
- Effect As flm.b4j.simplegameengine.effects.AbstractEffect
Gets or sets the effect applied to this actor. Note that effects are not cumulative. So any effect applied to a group will be ignored by an actor of this group having its own effect.
- FlipX As Boolean
Gets or sets whether this actor is flipped on the X axis.
- FlipY As Boolean
Gets or sets whether this actor is flipped on the Y axis.
- Height As Double [read only]
Gets the height of this group. This height is computed according to the group content.
- RotateAroundCenter As Boolean
Gets or sets whether the rotation is done around the center (true) or around the origin (false).
- Rotation As Double
Gets or sets the rotation angle in degrees.
- ScaleX As Double
Gets or sets the scale of this actor in the horizontal direction relative to its width.
- ScaleY As Double
Gets or sets the scale of this actor in the vertical direction relative to its height.
- Tag As Object
- Visible As Boolean
Gets or sets whether this actor is shown or hidden.
- Width As Double [read only]
Gets the width of this group. This width is computed according to the group content.
- X As Double
Gets or sets the global X position. The X,Y coordinates are relative to the canvas origin.
- Y As Double
Gets or sets the global Y position. The X,Y coordinates are relative to the canvas origin.
sgeScreen
Functions:
- Initialize (EventPrefix As String)
Creates a new screen. This screen will redirect all events when it becomes active.
- IsInitialized As Boolean
- toString As String
sgeSegment
Functions:
- Contains (P2D As sgePoint2D) As Boolean
Tests if the given point lies on this segment.
- Contains2 (X As Double, Y As Double) As Boolean
Tests if the given point lies on this segment.
- Equals (Segment As sgeSegment) As Boolean
Tests if the specified segment has the same start and end positions as this segment.
- Initialize (X1 As Double, Y1 As Double, X2 As Double, Y2 As Double)
Creates a segment going from X1,Y1 to X2,Y2.
- IsInitialized As Boolean
Properties:
- Length As Double [read only]
- Midpoint As sgePoint2D [read only]
- Tag As Object
- X1 As Double
- X2 As Double
- Y1 As Double
- Y2 As Double
sgeSound
Fields:
Functions:
- Initialize (Dir As String, Filename As String)
Creates a new audio clip loaded from the specified file.
- IsInitialized As Boolean
- IsPlaying As Boolean
Indicates whether this audio clip is playing.
- Play
Plays the audio clip.
- Play2 (Volume As Double)
Plays the audio clip with the specified volume. This function does not modify the value of the Volume property.
- Stop
Immediately stops all playback of this audio clip.
Properties:
- Balance As Double
Gets or sets the relative left and right volume levels of the clip. Valid range is -1 to 1 where -1 gives full volume to the left channel while muting the right channel, 0 gives full volume to both channels and 1 gives full volume to right channel and mutes the left channel. Default = 0.
- CycleCount As Int
Gets or sets the number of times the clip will be played when Play is called. Setting this to CYCLE_INDEFINITE will cause the clip to continue looping until Stop is called. Default = 1.
- Pan As Double
Gets or sets the relative "center" of the clip. A Pan value of 0 plays the clip normally where -1 shifts the clip entirely to the left channel and 1 shifts entirely to the right channel. Unlike Balance this setting mixes both channels so neither channel loses data. Default = 0.
- Priority As Int
Gets or sets the relative priority of the clip with respect to other clips. This value is used to determine which clips to remove when the maximum allowed number of clips is exceeded. Default = 0.
- Rate As Double
Gets or sets the relative rate at which the clip is played. Valid range is 0.125 (1/8 speed) to 8.0 (8x speed); values outside this range are clamped internally. Default = 1.
- Volume As Double
Gets or sets the relative volume level at which the clip is played. Valid range is 0 (muted) to 1 (full volume). Default = 1.
sgeSpline
Fields:
- BASIS_SPLINE As Byte
Smoothing spline. Also known as B-spline. The resulting curve is not required to pass through each control point.
- CATMULLROM_SPLINE As Byte
Interpolating spline. The resulting curve passes through each control point.
Functions:
- Initialize (SplineType As Byte, ControlPoints As sgePoint2D(), Continuous As Boolean)
Creates a spline of the given type (one of the ..._SPLINE constants).
- NearestControlPoint (X As Double, Y As Double) As Int
Returns the control point closest to the specified point.
- ValueAt (Loc As Float) As sgePoint2D
Returns the value of this spline at the given location (from 0 to 1).
- ValueAt2 (Span As Int, Loc As Float) As sgePoint2D
Returns the value of this spline at the given location (from 0 to 1) of the specified span (from 0 to ControlPoints.Length - 1).
Properties:
- ControlPoints As sgePoint2D()
Gets or sets the control points of this spline.
sgeText
Fields:
- HORIZONTAL_ALIGNMENT_CENTER As javafx.scene.text.TextAlignment
- HORIZONTAL_ALIGNMENT_LEFT As javafx.scene.text.TextAlignment
- HORIZONTAL_ALIGNMENT_RIGHT As javafx.scene.text.TextAlignment
- VERTICAL_ALIGNMENT_ABOVE As javafx.geometry.VPos
- VERTICAL_ALIGNMENT_BELOW As javafx.geometry.VPos
- VERTICAL_ALIGNMENT_CENTER As javafx.geometry.VPos
Functions:
- Initialize (Text As String, Font As javafx.scene.text.Font)
Creates a new text with the given string and font.
- Initialize2 (Text As String, Font As javafx.scene.text.Font, HorizontalAlignment As javafx.scene.text.TextAlignment)
Creates a new text with the given string, font and alignment.
- IsInitialized As Boolean
- toString As String
Properties:
- Filled As Boolean
Gets or sets whether the text is filled with FontColor. Default = True
- Font As javafx.scene.text.Font
Gets or sets the font of this text. Default = fx.DefaultFont(12)
- FontColor As javafx.scene.paint.Color
Gets or sets the font color of this text. Default = fx.Colors.Black
- HorizontalAlignment As javafx.scene.text.TextAlignment
Gets or sets the horizontal text alignment, relative to the X position. Default = HORIZONTAL_ALIGNMENT_LEFT
- LineHeight As Float [read only]
Returns the height in pixels of a line of text.
- MaxWidth As Int
Gets or sets the maximum width of this text. If the width of the text extends past this value, then it will be sized to fit.
- Text As String
Gets or sets the string to display.
- TextHeight As Double [read only]
Returns the height in pixels of this text.
- TextWidth As Double [read only]
Returns the width in pixels of this text.
- VerticalAlignment As javafx.geometry.VPos
Gets or sets the vertical text alignment, relative to the Y position. Default = VERTICAL_ALIGNMENT_BELOW
sgeTiledMap
Fields:
- ORIENTATION_HEXAGONAL As String
- ORIENTATION_ISOMETRIC As String
- ORIENTATION_ORTHOGONAL As String
- ORIENTATION_STAGGERED As String
Functions:
- GetImageLayer (Name As String) As sgeTiledMapImageLayer
Retrieves an image layer with the given name.
- GetObjectLayer (Name As String) As sgeTiledMapObjectLayer
Retrieves an object layer with the given name.
- GetProperty (Name As String) As String
Retrieves a custom property of this tiled map with the given name.
- GetTile (id As Int) As sgeMapTile
Returns the tile with the given ID.
- GetTileLayer (Name As String) As sgeTiledMapTileLayer
Retrieves a tile layer with the given name.
Properties:
- BackgroundColor As String [read only]
Gets the background color of this tiled map.
- HexSideLength As Int [read only]
Gets the size of the tile's edge for hexagonal maps (in pixels).
- Layers As List [read only]
Returns the list of layers of this tiled map. It's a copy so adding or removing items has no consequence on the original list.
- MapHeight As Int [read only]
Gets the map height in tiles.
- MapWidth As Int [read only]
Gets the map width in tiles.
- OptimizedRendering As Boolean
Gets or sets whether the layer rendering is optimized by limiting the number of tiles to render. Default = True.
- Orientation As String [read only]
Gets the map orientation (one of the ORIENTATION_... constants).
- PixelHeight As Double [read only]
Gets the map height in pixels.
- PixelWidth As Double [read only]
Gets the map width in pixels.
- Properties As Map [read only]
Returns a Map containing all custom properties of this tiled map.
- StaggerAxis As String [read only]
Gets which axis ("x" or "y") is staggered for staggered and hexagonal maps.
- TiledVersion As String [read only]
Returns the version of Tiled that was used to create the map.
- TileHeight As Int [read only]
Gets the height of a tile.
- Tilesets As Map [read only]
Returns a Map containing all tilesets of this tiled map.
- TileWidth As Int [read only]
Gets the width of a tile.
sgeTiledMapImageLayer
Functions:
- AddProperty (Name As String, Value As String)
Adds a custom property to this layer.
- GetProperty (Name As String) As String
Retrieves a custom property of this layer with the given name.
Properties:
- Image As Image
- Name As String [read only]
Gets the name of this layer.
- OffsetX As Int [read only]
Gets the horizontal rendering offset for this layer in pixels.
- OffsetY As Int [read only]
Gets the vertical rendering offset for this layer in pixels.
- Opacity As Float
Gets or sets the opacity of this layer (a value from 0 to 1).
- Properties As Map [read only]
Returns a Map containing all custom properties of this layer.
- TiledMap As sgeTiledMap [read only]
Returns the tiled map containing this layer.
- Visible As Boolean
Gets or sets whether the layer is shown or hidden.
sgeTiledMapObject
Fields:
- SHAPE_ELLIPSE As Byte
- SHAPE_IMAGE As Byte
- SHAPE_POINT As Byte
- SHAPE_POLYGON As Byte
- SHAPE_POLYLINE As Byte
- SHAPE_RECTANGLE As Byte
- SHAPE_TEXT As Byte
Functions:
- AddProperty (Name As String, Value As String)
Adds a custom property to this object.
- GetProperty (Name As String) As String
Retrieves a custom property of this object with the given name.
- toString As String
Properties:
- FlipX As Boolean
Gets or sets whether the tile representing this object has to be horizontally flipped when drawn.
- FlipY As Boolean
Gets or sets whether the tile representing this object has to be vertically flipped when drawn.
- Height As Double
Gets or sets the height of this object.
- ID As Int [read only]
Returns the unique ID of this object.
- Name As String [read only]
Returns the name of this object, if any.
- Points As sgePoint2D() [read only]
Returns an array of sgePoint2D containing the points coordinates of the polygon or polyline of this object.
- Properties As Map [read only]
Returns a Map containing all custom properties of this object.
- Rotation As Double
Gets or sets the rotation of this object in degrees clockwise.
- Shape As Byte [read only]
Returns the shape of this object (one of the SHAPE... constants).
- TileID As Int [read only]
Returns the ID of the tile representing this object, or -1 if there's no associated tile.
- Type As String [read only]
Returns the type of this object, if any.
- Visible As Boolean
Gets or sets whether the object is shown or hidden.
- Width As Double
Gets or sets the width of this object.
- X As Double
Gets or sets the X coordinate of this object.
- Y As Double
Gets or sets the Y coordinate of this object.
sgeTiledMapObjectLayer
Functions:
- AddProperty (Name As String, Value As String)
Adds a custom property to this layer.
- GetProperty (Name As String) As String
Retrieves a custom property of this layer with the given name.
Properties:
- Color As String [read only]
Gets the color used to display the objects.
- Name As String [read only]
Gets the name of this layer.
- Objects As List [read only]
Returns the list of objects of this layer. It's a copy so adding or removing items has no consequence on the original list.
- OffsetX As Int [read only]
Gets the horizontal rendering offset for this layer in pixels.
- OffsetY As Int [read only]
Gets the vertical rendering offset for this layer in pixels.
- Opacity As Float
Gets or sets the opacity of this layer (a value from 0 to 1).
- Properties As Map [read only]
Returns a Map containing all custom properties of this layer.
- TiledMap As sgeTiledMap [read only]
Returns the tiled map containing this layer.
- Visible As Boolean
Gets or sets whether the layer is shown or hidden.
sgeTiledMapTileLayer
Functions:
- AddProperty (Name As String, Value As String)
Adds a custom property to this layer.
- GetCell (X As Int, Y As Int) As sgeMapCell
Gets the cell at the given coordinates.
- GetProperty (Name As String) As String
Retrieves a custom property of this layer with the given name.
Properties:
- Name As String [read only]
Gets the name of this layer.
- OffsetX As Int [read only]
Gets the horizontal rendering offset for this layer in pixels.
- OffsetY As Int [read only]
Gets the vertical rendering offset for this layer in pixels.
- Opacity As Float
Gets or sets the opacity of this layer (a value from 0 to 1).
- Properties As Map [read only]
Returns a Map containing all custom properties of this layer.
- TiledMap As sgeTiledMap [read only]
Returns the tiled map containing this layer.
- Visible As Boolean
Gets or sets whether the layer is shown or hidden.
sgeUtils
Functions:
- ConvertWebColor (WebColor As String) As javafx.scene.paint.Paint
Converts the given HTML or CSS color string to a RGB color.
- Crop (Image As Image, X As Int, Y As Int, Width As Int, Height As Int) As Image
Crops the given image by the specified rectangle.
- GetPixels (Image As Image) As Int()
Reads pixel data from the given image. Returns an array of integers.
- GetPixels2 (Image As Image, Pixels As Byte())
Stores the pixel data from the given image into the specified byte array. Each pixel is described by 4 bytes: blue, green, red, alpha. Thus, the size of the array must be equal to width x height x 4.
- ReduceColorsTo256 (Image As Image, Sampling As Int) As Image
Reduces the number of colors of the given image to 256. This operation may take several seconds depending on the image size and sampling value.
Sampling: Sampling factor of the quantization algorithm. From 1 (slow, but good quality) to 30 (fast, but low quality).
- SetPixels (Pixels As Int(), Width As Int, Height As Int) As Image
Stores pixel data from the given int array into an image.
- SetPixels2 (Pixels As Byte(), Width As Int, Height As Int) As Image
Stores pixel data from the given byte array into an image. Each pixel is described by 4 bytes: blue, green, red, alpha.
sgeVehicle
Fields:
- LOCATION_ALIGNED As Byte
- LOCATION_BEHIND As Byte
- LOCATION_IN_FRONT As Byte
- LOCATION_ON_THE_LEFT As Byte
- LOCATION_ON_THE_RIGHT As Byte
Functions:
- ApplyBehavior (Elapsed As Double) As sgePoint2D
Applies the current behavior, if any, and returns the resulting force.
- ApplyBehavior2 (Behavior As sgeBehavior, Elapsed As Double) As sgePoint2D
Applies the specified behavior and returns the resulting force.
- FuturePosition (Elapsed As Double) As sgePoint2D
Computes the future position based on the current velocity.
- GetRelativeLocation (Point As sgePoint2D) As sgePoint2D
Returns the location of the specified point relative to this vehicle.
The X value is either LOCATION_ON_THE_LEFT, LOCATION_ON_THE_RIGHT or LOCATION_ALIGNED.
The Y value is either LOCATION_IN_FRONT, LOCATION_BEHIND or LOCATION_ALIGNED.
- Initialize
- Initialize2 (MaxVelocity As Double)
- Initialize3 (MaxVelocity As Double, MaxAngularChange As Double, MaxAcceleration As Double, MaxDeceleration As Double)
- Move (Elapsed As Double)
Updates the vehicle position according to its current velocity.
- Steer (SteeringForce As sgePoint2D)
Applies a steering force to the vehicle velocity.
This steering force is limited by MaxAcceleration and MaxDeceleration.
Properties:
- Angle As Double [read only]
Gets the direction of this vehicle, in degrees.
- AutoRotateActor As Boolean
Gets or sets whether the actor associated to this vehicle is rotated automatically when the velocity changes. Default = True.
- Behavior As sgeBehavior
Gets or sets the behavior to be applied to this vehicle.
- IsInitialized As Boolean [read only]
- MaxAcceleration As Double
Gets or sets the maximum amount of change in velocity when accelerating. Default = 0.1.
- MaxAngularChange As Double
Gets or sets the maximum amount of angular change, in degrees. Default = 45.
- MaxDeceleration As Double
Gets or sets the maximum amount of change in velocity when decelerating. Default = 0.1.
- MaxVelocity As Double
Gets or sets the maximum allowed velocity, in pixels per millisecond. Default = 0.1.
- Position As sgePoint2D
Gets or sets the position of this vehicle.
- Tag As Object
- Velocity As sgePoint2D
Gets or sets the velocity of this vehicle. The vector magnitude cannot be higher than MaxVelocity. Default = (0, 0).
If an actor is associated to this vehicle and AutoRotateActor is True, any change of velocity will rotate the actor so its right side faces the move direction.
Author: F. Leneuf-Magaud (Informatix)