V32 Up! [MONKEY NEWS]
Monkey Forums/Monkey Programming/V32 Up! [MONKEY NEWS]
| ||
Hi, MonkeyPro V32 is now up. The 2 BIG changes are: * Flash now embeds data - 'file based' data currently disabled, but will re-enable it eventually. * Android now uses a GL driver. The old driver is disabled for now, may re-enable later, although I really think it's too underpowered to do anything with... * Error "" added to 'exit app'. Android/iOS design guidelines do not recommend this (and I agree - I like persistent apps), but it does make life simpler for the coder. * Oh, and android 'back button' maps to KEY_ESCAPE - always did! I spent some time making targets more 'stand alone' (ie: independent of Mojo) so you'll probably need to delete a lot of .build dirs - but I now think this approach is a bit pointless. A better approach would IMO be to allow easier addition of targets. This is a little tricky, because there is quite a bit of messy target specific stuff involved in building - but I'm working on it. Modules: JS/AS now use built-in join(). Implemented custom string_replace for JS and AS targets to avoid regex issues. Seems you can have non-regex, OR global replace, but not both! Flash target can now be used mojo-less - this is probably a pointless exercise, will revisit eventually. Android mojo nows uses GL! Added simple glfw LoadState/SaveState. Fixed XNA shift/control input issues. Mojo font now loads at startup. LoadImage/LoadSound errors consistently return Null objects. Flash data embedded! Will eventually be selectable. Note: flash file names must be valid identifiers for now. Error "" added - use to 'exit app'. Android target 'screensaver' disabled via android:keepScreenOn="true" in layout/main.xml App suspend/resume improvements. Trans: Bumped to v1.03. Fixed default multi-dim array values in java/c#. Fixed unary expr after EOL causing syntax error. 'Then' now also allowed after 'Else If'. Fixed Shl=, Shr=- and Mod=. Fixed overriding methods not matching superclass methods. Fixed default ctors being generated when suitable ctor with defaults params already exists. Func/var decls can now handling EOLs after commas. |
| ||
Thanks Mark! LoadImage/LoadSound errors consistently return Null objects. lol - I started checking the loaded width and height to make sure that they were greater than zero :) [Edit - Any chance that we could get a clean flag, which deletes the targets build folder before rebuilding?] |
| ||
I should've mentioned this in the string replace thread - you could just stick a backslash in front of every character in the string, to make a regexp matching exactly and only that string. That might be slightly faster than a custom-made replace function. |
| ||
Thanks Mark. I have been waiting to see if the flash thing was on the cards to be looked at! Has it is a must for a little project I have planned for the future. |
| ||
Any chance of getting OnResume/OnSuspend working in HTML5 mode? more here: http://www.monkeycoder.co.nz/Community/topics.php?forum=201 |
| ||
GREAT! |
| ||
@marksibly: Great! Is the HTML5 issue with Replace() I reported fixed? @therevills: Yep, I do the same thing to check if an image is correctly loaded. I will have to rewrite my code so it works with this new (and more appropiate) way. |
| ||
Hi, > Any chance of getting OnResume/OnSuspend working in HTML5 mode? Yes, eventually, but there are quite a few things to consider. The 'easy way' (I think it's just commented out) works, but it suspends the canvas as soon as you click outside of it. This is probably desirable in some cases, but not in all so there needs to be some kind of config option here I think, but I'm not sure what people want... I was unable to get it behave the way I preferred at all (ie: click on canvas to set focus, but leave whole page to lose focus) as onblur doesn't seem to work when tabbing away from a page. So yes, more work to be done here - but the code to invoke onsuspend/onresume is in mojo.html5.js so feel free to have a play and suggest approaches. As for Flash, it just seemed pretty much random whether onfocus/onblur worked and it was holding things up so I let it slide for now... |
| ||
Ok, thanks for the insight Mark. Will give it some thought... |
| ||
EDIT: IGNORE THIS -- It's something to do with my unused data files in the .data folder. |
| ||
Awesome! Thanks. |
| ||
Android now uses a GL driver. This has provided a significant increase in speed and proper blend modes! Whoop! One thing I have noticed, although I've yet to try and determine the cause, when running my perticles test, I see 'vertical static', it's like small artifacts that following the sprites. *EDIT* It's because my sprites weren't a power of 2, changing them to 32x32 or 64x64 solves it. |
| ||
This now crashes with V32, works okay in V31: It crashes trying to load player 3 image when using functions to do the loading: Image frame outside surface |
| ||
Hi, Can you email me the image? |
| ||
Hi, > One thing I have noticed, although I've yet to try and determine the cause, when running my perticles test, I see 'vertical static', it's like small artifacts that following the sprites. Should still work even without power-of-2 sprites - can you send me the source or a small demo that shows the problem? |
| ||
Sent to your gmail account Mark. Also just tested my Invaders code on Android - OpenGL version is great! A lot faster and the sound pauses when you hit Home... The slow down on touch is also lot better, on my test app it runs at 62-66 FPS, when I touch it, it drops to 56 FPS for a spllt second then returns back to 60+ FPS. |
| ||
Hi, > Image frame outside surface It's 'coz you've used '-1' for image flags at some point. This is turning on the new image padding which is reducing image size by 2. See new Image class docs for more on padding. |
| ||
Ahh - Thanks Mark! Im having a hard time finding the consts for the flags, could you please tell me the integer values of the consts? Const MidHandle=1 |
| ||
Hi, Use the names: Image.MidHandle Image.XPadding Image.YPadding Image.XYPadding Oops - docs are missing 'newlines' between consts... |
| ||
Strange... JungleIDE is pointing to V32, but when I "Jump to definition" on Image it points to an old version, so thats why I couldnt find the const.Const MidHandle=1 'Padding is currently experimental - it WILL change! Const XPadding=2 Const YPadding=4 Const XYPadding=XPadding|YPadding Any chance that we could get a clean flag, which deletes the targets build folder before rebuilding? |
| ||
but when I "Jump to definition" on Image it points to an old version, so thats why I couldnt find the const. After an update, go to Monkey / Refresh modules database to let Jungle "know" latest changes in your modules. |
| ||
Yep - worked it out :) Thanks Ziggy |
| ||
Great, thanks Mark! :) |
| ||
* Oh, and android 'back button' maps to KEY_ESCAPE - always did! Doesn't work on my android phone *EDIT. Sorry, it does work! :) I was using KeyDown(KEY_ESCAPE) which didnt work. But KeyHit(KEY_ESCAPE) is working. Also can we please have a way of change the name of apk file so it doesn't constantly overwrite any existing monkey app installed on android? |
| ||
BTW the mojo_font has been updated since V32 - so if you are going to upload a new version of you apps to a website which was using the old font, ensure you update the font too :P http://www.monkeycoder.co.nz/Community/posts.php?topic=390 |
| ||
Thanks Mark |
| ||
I was using the demo before buying v32 So im new to this version, mojo.STD.cpp cant be found for the cpp target |
| ||
You need to use the glfw target when using mojo. The stdcpp target is only meant for the trans module. |
| ||
thanks :) |
| ||
Ok but how do you get an image to MidHandle? What's the actual code? |
| ||
Global img_Thing:Image img_Thing = LoadImage("thing.png",0,img_Thing.MidHandle) |
| ||
the bouncyaliens demo in bananas/mak has a lot of image related code to learn from |