About Monkey 2 › Forums › Monkey 2 Projects › Playniax news
Tagged: Defenstar, Pyro2, Revengestar, Tiled, Typoooh
This topic contains 181 replies, has 23 voices, and was last updated by
Amon
6 months, 3 weeks ago.
-
AuthorPosts
-
May 16, 2017 at 7:08 pm #8189
Hi Xaron,
Yes, I added SetVirtualHeight() and SetVirtualWidth() to the camera class. You use one or the other. For example SetVirtualHeight( 640 ) would set a height and the width stretches according to ratio so your virtual height is always 640
Same goes for SetVirtualWidth()
The camera VirtualWidth and VirtualHeight will return the correct values.
This is not ‘officially added’ because I need to test it with camera zooming, rotating etc. but if you don’t use the zoom or rotating it should work fine, actually I am using it in Revengestar.
May 17, 2017 at 6:44 am #8190Thanks, will try it out!
June 2, 2017 at 12:21 pm #8427Tony, could you please provide me an example for that one please? Just for a landscape with fixed height but floating width would be awesome. I’m not clear how to achieve that yet :/
I did something like:
[/crayon]Monkey123456789101112[crayon-5cba8836525bd117997193 inline="true" ]Class Game Extends ScreenField camera:CameraField scene:SceneField background:ImageMethod New()scene=New Scene( ScreenManager )camera = New Camera( scene )camera.SetVirtualHeight( 360 )background = Content.GetImage( "asset::background.png" )End MethodI probably need OnMeasure in the ScreenManager as well, right? I’ve added it and tried different Layouts (like “strech”, “letterbox”)…
Here’s the background image I use. Base resolution should be 640×360 (16:9 aspect) which can go as low as 480×320 for a 4:3 device. The red line should be on the right border in that case, so the image should be cropped.
June 2, 2017 at 3:52 pm #8431[/crayon]Monkey123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051[crayon-5cba883655dd9841910358 inline="true" ]#Import "assets/background.png"#Import "<std>"#Import "<mojo>"#Import "<pyro-scenegraph>" ' Import pyro scene.Using std..Using mojo..Using pyro.framework..Using pyro.scenegraph..Global scene:SceneClass PyroExample Extends WindowMethod New( title:String,width:Int,height:Int,flags:WindowFlags=WindowFlags.Resizable )Super.New( title,width,height,flags )scene=New Scene( Self )Local camera:=New Camera( scene )Local layer:=New Layer( scene )camera.SetVirtualWidth( 960 )Local background:=New LayerSprite( layer,Content.GetImage( "asset::background.png" ) )background.Location=camera.VirtualResolution/2 ' Center of the screen.EndMethod OnRender( canvas:Canvas ) OverrideApp.RequestRender()scene.Update() ' Update must be called before Draw!scene.Draw( canvas ) ' Draw all scene objects to canvas.EndEndFunction Main()New AppInstanceNew PyroExample( "Pyro example",640,480 )App.Run()EndI probably need OnMeasure in the ScreenManager as well, right? I’ve added it and tried different Layouts (like “strech”, “letterbox”)…
No, you don’t need it. Best to avoid it…
June 2, 2017 at 6:29 pm #8435Thanks Tony, works quite well. How could I dynamically adapt it so it would change when the window is resized.
June 3, 2017 at 6:55 am #8444By moving parts to OnRender or OnUpdate so that it recalculates things that depend on the screen dimensions.
In this case camera.SetVirtualWidth( 960 ) and background.Location=camera.VirtualResolution/2Better make background a field or global in this case.
June 6, 2017 at 10:55 am #8503Revengestar coming soon!
June 17, 2017 at 2:47 pm #8801Just finished the last level!!!
Now time for some real testing and get get it ready for the stores!


June 20, 2017 at 3:43 pm #8829June 20, 2017 at 4:46 pm #8830Looks good any plans for a Linux version
June 20, 2017 at 6:47 pm #8831Looks great
June 21, 2017 at 2:54 am #8841Nice graphics and visual effects! Well done.
June 23, 2017 at 12:43 pm #8880Thanks guys!
Linux version maybe later. First iOS and Android.
I just added the OSX version to itch!
July 8, 2017 at 4:04 am #9176Pyro2 v1.0.3 is available!!!
An update of the Monkey2 / Pyro2 package is available on itch and I just uploaded an update to the module manager so I expect the update to be available for download anytime now.
This is an important update! It has countless fixes and some nice additions. This is the version that is driving Revengestar and Dumbot so it should be very stable.
I am also finishing up a Tiled loader. There is already a Pyro2 Tiled converter available and it works fine but while working on Dumbot I found it not very practical to convert the tilemap everytime it got an update. The Pyro2 Tiled loader can load tmx files directly eliminating the need to convert ( timesaver! ). I hope to finish and release the Tiled loader coming week!
Summary fixes and updates Pyro2 v1.0.3
• Fixed gui touch / mouse issues!
• Fixed tiled animation timing issues!• Changed OnOutro() to OnOutro( layerObject:LayerObject ) for the scenegraph layer objects
This way you can pass the object that caused the collision
• Added CreateImageMask command
• Added PixmapToTilemap command
• Added Screenshot command
• Added ScreenshotImage commandThe Pyro2 bananas moved to the Pyro2 module folders and Pyro2 demos and templates ( Pyro2 essentials ) can be downloaded here
July 12, 2017 at 2:30 pm #9275 -
AuthorPosts
You must be logged in to reply to this topic.