You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a major release of the EndGate framework. Several breaking changes are included in this release as well as several significant features and a few bug fixes.
varplayer=this.Content.LoadAudio("myAudio","foo/bar.mp3");player.Play();this.Content.GetAudio("myAudio");// This return value is "player"this.Content.UnloadAudio("myAudio");
Before:
SquareTileMap's loaded all tiles synchronously resulting in them being drawn as an entire graphic once they were added to the scene. Now:
SquareTileMap's load tiles asynchronously. To have near the same behavior as before you should tie into the SquareTileMap's OnLoaded event handler to determine when the SquareTileMap has finished loading. Otherwise you can keep your existing code if you don't mind seeing SquareTileMap's loaded in asynchronously (you will see the map load in row by row).
classMyCollidableextendseg.Collidable{constructor(){super(neweg.Bounds.BoundingCircle(eg.Vector2d.Zero,3));}// Note that CollisionData is now in the Collision namespace.publicCollided(data: eg.Collision.CollisionData): void{// All At did was capture the position of "me", so there's really no need to capture that value because we already have it!variCollidedAt: eg.Vector2d=this.Bounds.Position;}}
varcircle=neweg.Graphics.Circle(0,0,5,"red");// Change the circle's color to yellow (multiple different ways, all are equivalent)circle.Color.G=255;// Since we initialized it to red, changing the green component to 255 makes yellowcircle.Color="yellow";circle.Color=eg.Graphics.Color.Yellow;circle.Color=neweg.Graphics.Color(255,255,0);circle.Color=neweg.Graphics.Color(255,255,0,1);circle.Color=neweg.Graphics.Color("yellow");circle.Color=neweg.Graphics.Color("rgb(255, 255, 0)");circle.Color=neweg.Graphics.Color("rgba(255, 255, 0, 1)");
classMyGameextendseg.Game{private_emitter: eg.Particles.Emitter;constructor(){super();varemitter=neweg.Particles.Emitter(0,0,eg.Tweening.Functions.Linear.EaseNone);// Build a pool of textures that the emitter randomly selects to emit.emitter.AddTexture(neweg.Graphics.Circle(0,0,5,"red"));emitter.AddTexture(neweg.Graphics.Rectangle(0,0,10,10,"green"));emitter.AddTexture(neweg.Graphics.Line2d(0,0,10,10,3,"black"));emitter.AddTexture(neweg.Graphics.Text2d(0,0,"Hello World","blue"));emitter.Start();// Emitter has several different properties that can be modified to affect how the emitter emits particles. Take a look at the Particles sample to learn more.this.Scene.Add(emitter);this._emitter=emitter;}publicUpdate(gameTime: eg.GameTime): void{this._emitter.Update(gameTime);}}
classMyGameextendseg.Game{constructor(){super();}publicLoadContent(): void{// This assumes "mapJson" is set to your maps JSON data.eg.MapLoaders.JSONLoader.Load(mapJson,(result: eg.MapLoaders.IMapLoadedResult)=>{// Triggered when the map has finished loadingfor(vari=0;i<result.Layers.length;i++){this.Scene.Add(result.Layers[i]);}};}}
The CollisionManager has been highly optimized. It now uses a dynamically re-sizing quad tree to speedy collision checks. This also involved adding a new parameter to the CollisionManager's Monitor method to indicate if a Collidable is static or not. If a Collidable is static it means that it will not move throughout its life time and it cannot collide with other static objects (since they don't move). Change the CollisionManager to utilize quad trees #6
classRockextendsCollidable{constructor(){super(neweg.Bounds.BoundingCircle(eg.Vector2d.Zero,10));}}classMyGameextendseg.Game{constructor(){super();/* * To further optimize the QuadTree you can change the games collision configuration * Aka: this.Configuration.CollisionConfiguration.MinQuadTreeNodeSize and this.Configuration.CollisionConfiguration.InitialQuadTreeSize */// Monitor the rock for collisions but it cannot move, it's "static". By letting the CollisionManager know that it's static it can further optimize its collision checking algorithm to increase performance.this.CollisionManager.Monitor(newRock(),true);}}
Graphic2d's now implement ICloneable, therefore graphics can be created and cloned via the Clone method. Make Graphic2d's ICloneable #65
Graphic2d's now have a Scale method, it takes in a number to multiply the size of the Graphic2d by. This allows for generic sizing of Graphic2d's. Add a scale method to Graphic2d #63
ImageSource now implements ICloneable. You do not need to call Extract or create a new ImageSource in order to create a copy of your ImageSource, just call the Clone method. Make ImageSource ICloneable #59
Graphic2d's now have an AbsolutePosition property. AbsolutePosition is used to locate the exact location of a Graphic2d, despite its Parent's. This becomes useful when trying to locate where a child Graphic2d is in the context of the entire scene. Add Parent and AbsolutePosition members to Graphic2d #54
The Grid class has been optimized to only build it's grid lines when the DrawGridLines property has been set to true. This will result in a much smaller memory footprint and will increase the grid's overall speed. Dont build grid's gridlines unless drawgridlines is set to true #37
SquareTileMap's are now loaded asynchronously, with this feature the SquareTileMap's now have a OnTileLoaded and OnLoaded events to tie into. Add SquareTileMap tile loaded bindings #36
This is a major release of the EndGate framework. Several breaking changes are included in this release as well as several significant features and a few bug fixes.
Breaking Changes
In previous releases you could add "scenery" to the game by doing the following within your game class:
Now the equivalent of this is:
Note: ZIndexes between existing scenery objects will now be competing for draw order against other element within the game scene.
Before:
Now:
Before (inside a game):
Now (equivalent inside a game):
Before:
SquareTileMap's loaded all tiles synchronously resulting in them being drawn as an entire graphic once they were added to the scene.
Now:
SquareTileMap's load tiles asynchronously. To have near the same behavior as before you should tie into the SquareTileMap's OnLoaded event handler to determine when the SquareTileMap has finished loading. Otherwise you can keep your existing code if you don't mind seeing SquareTileMap's loaded in asynchronously (you will see the map load in row by row).
Before:
Now:
Before:
Now:
Before:
Now:
Features
Usage:
Usage:
Usage:
Usage:
Usage:
Bug Fixes
The text was updated successfully, but these errors were encountered: