- Joined
- Jun 26, 2017
- Messages
- 886
Hey Everyone!
I am going to try out some changes that could be called "breaking changes" as they could make changes to you your code base necessary or that need a special config setting to make it work like before. That said, I am announcing this before I put it on GitHub and I also plan have those changes in a "experimental" branch first for everyone to see and check out for themselves.
Those are my current plans for changes:
You might ask why I'd like to apply those changes. The main reason is to make Cerberus X as easy as possible to start with especially for beginners. With the current version of mojo2 I even find myself using old mojo whenever I try things that are not graphics related just to avoid the additional boilerplate code. With the beforementioned changes simple examples boil down to something like this:
I recently started using this on a regular basis to make sure it has no unwanted side effects. If you have any objections please call them out.
The reason I am coming up with those changes now is because if I need to change something about how Cerberus operates it is best to do it now before I release the new docs and rewrite the examples with it, and of course before I invest heavily into getting new users on our site.
Let me know what you think!
All the best,
Phil
I am going to try out some changes that could be called "breaking changes" as they could make changes to you your code base necessary or that need a special config setting to make it work like before. That said, I am announcing this before I put it on GitHub and I also plan have those changes in a "experimental" branch first for everyone to see and check out for themselves.
Those are my current plans for changes:
Changed behaviour | Potential issues with it | Optional setting to get original behaviour |
---|---|---|
Make return type "Void" optional for functions/methods in "Strict" mode. | No real issue. Only if you switch from non strict to "Strict" mode, methods without type change from Int to Void. | Hard coded into Trans -> No setting available |
Change return type of App callback methods to "Void", i.e. OnCreate(), OnRender(), ... | You need to change the return type of your overwriting methods to make them fire again. | Set #USE_COMPATIBILITY_MODE=True on top of imports in your main source file. |
Add global draw functions like with Canvas and DrawList | Those global functions could be shadowed if you are using the same names. | Set #MOJO2_DEFAULTCANVAS_ENABLED=False on top of imports in your main source file. |
You might ask why I'd like to apply those changes. The main reason is to make Cerberus X as easy as possible to start with especially for beginners. With the current version of mojo2 I even find myself using old mojo whenever I try things that are not graphics related just to avoid the additional boilerplate code. With the beforementioned changes simple examples boil down to something like this:
Cerberus:
Strict
Import mojo2
Function Main:Int()
New MyApp()
Return 0
End
Class MyApp Extends App
Method OnRender()
Clear()
DrawText("Hello World!", DeviceWidth()*0.5, DeviceHeight()*0.5, 0.5)
End
End
I recently started using this on a regular basis to make sure it has no unwanted side effects. If you have any objections please call them out.
The reason I am coming up with those changes now is because if I need to change something about how Cerberus operates it is best to do it now before I release the new docs and rewrite the examples with it, and of course before I invest heavily into getting new users on our site.
Let me know what you think!
All the best,
Phil