Plasmacore 4.0
From Plasmaworks
Contents |
Change Log for 4.0.0 (Upcoming Release)
Code Repository
- The Plasmacore code repository has been moved to Google code: http://code.google.com/p/plasmacore/
Preprocessor
- Platform defines have been renamed to follow the naming convention "PLATFORM_X". Statements like "[if defined(ANDROID)]" should be changed to "[if defined(PLATFORM_ANDROID)]". The current platforms are PLATFORM_MAC, PLATFORM_WINDOWS, PLATFORM_LINUX, PLATFORM_IOS, PLATFORM_ANDROID, and PLATFORM_WP7.
- Added priority attribute to image_manifest.txt. Higher priority images are placed on image sheets first, allowing you to work around non-optimal edge cases in the layout algorithm. All images have a default priority of zero; write "priority 1", "priority -2", etc. next to an image filename to change it.
Input
- You can now set the mouse cursor position with "Input.mouse_position = Vector2(x,y)". This only has an effect on platforms that have a mouse cursor.
- Input.mouse_button_state(id) returns true/false if button #1 of mouse #id (aka touch #id) is pressed. Input.mouse_button_state(id,2) returns true/false if button #2 of mouse #id is pressed, etc.
- Mouse input no longer gives relative movement messages (but it still gives absolute MouseEvent.movement messages). MouseEvent.relative_movement messages were not implemented across all platforms and it's easy to roll your own implementation - just subtract the old position from the current position on an absolute movement. You may wish to hide the mouse ("Input.mouse_visible = false") and set it back to the center of the screen after every movement ("Input.mouse_position = Display.center") to avoid its being constrained by screen edges.
- There is no longer a distinct repeat KeyEvent type. Instead, additional press events are dispatched with the is_repeat value set to true. You can also write "is_repeat('a')", etc. as before.
Display
- In call cases, bounds() is now provided as a shorthand equivalent to bounding_box(). For example, "Display.bounds" now returns the Box that frames the screen boundaries.
Mac Plasmacore
- Mac Plasmacore no longer uses SDL.
- Fullscreen mode is now supported ("Display.fullscreen = true").
- The Mac platform directory has been reorganized. To avoid mixing new files with old, unused files, you may wish to delete your project's "platforms/mac" directory before upgrading.
Windows Plasmacore
- Windows Plasmacore no longer uses SDL.
- The Windows platform directory has been reorganized. To avoid mixing new files with old, unused files, you may wish to delete your project's "platforms/windows" directory before upgrading.
Bard Language
- "Slag" has been renamed to "Bard" due to the negative connotations "slag" has in the United Kingdom.
- Operations on Real32 now work again (they hadn't since v3.1).
- Class scanner now has consume_id(String) and must_consume_id(String,[mesg]). Using just consume("abc") will match the first three characters of "abc " and "abcd", but consume_id("abc") only matches "abc" followed by a non-id character.
- Unified JSON classes and PropertyTable classes into a separate include "js_data.bard". Browse libraries/bard/standard/js_data.bard to see how to use it.
- Added new "Properties" class to the standard library that stores flat String mappings under either a general category or a specialized other category. It is ideal for storing configuration and save data.
- Singletons created at launch no longer have their default initializer init() called. Instead, if a method named init_singleton() is defined then it will be called after init_object(). Example:
# This program prints:
# singleton_init()
# Hello World 1!
# init()
# Hello World 2!
# Hello World 1!
class Test
method init
SingletonTest.speak
SingletonTest().speak
SingletonTest.speak
endClass
class SingletonTest
PROPERTIES
value : Int32
METHODS
method init_singleton
value = 1
method init
value = 2
method speak
println( "Hello World $!" (value) )
endClass