The native classes are the most important part which is responsible for all features supported by Moscrif. This release stabilizes the native class. Many bugs were fixed but the release also brings some new features.
ScrollView – new mode
To the scrollView class was added new scrollMode #none. Currently supported scrollModes are #none, #horz, #vert and #both. Using this scroll mode is able to create a list of items which scrolls only if it is needed (scroll only if there are more items as can be displayed without scrolling).
Now, our applications can also rotate according to the device. From this version is this feature supported also on Android devices (Android 2.2 and later). To enable the device rotation is firstly needed to set supported orientations. It is set in orientation property of native Moscrif.Window class. This property has not been mapped to the framework yet, because it is needed to set it in the native object.
game.onStart = function()
// set supported orientations
this._window.orientation = [#portrait, #landscape-left];
Then, when device orientation changes is called event onOrientationChanged. It is mapped to the framework.
game.onOrientationChanged = function(sender, orientation)
orientation was changed
In this version of emulator settings more affect the project simulation. From now the emulator considers all projects’ settings for platform which it simulates. It means that if the developer forgets to set the font for Android and he starts emulator for Android the emulator shows an error that font is missing.
Except these new features many bugs were fixed. Probably, the most important fixed bugs were bug with a hardware keyboard, where was no options how to change the type of keyboard, or the long delay after splash screen on Android 2.2. Also the axes of accelerometer in landscape mode are now in the correct direction. All changes are available in the next list
Bug Fix Generic
- Box2d, object already disposed problem
- Orientation, Window.orientation, Windows.onOrientationChanged
- Accelerometer in landscape modeB
Bug fix Android
- Publishing tools,problem in sdk Version
- Android 2.2, Splash delay problem
- Web DeviceID
- Image operations
- Improved font usage simulation
- Added #none for ScrollView
- Added property View.childredCount, Window.childrenCount
Also framework has undergone many changes since the last release. The first change which affects all objects is that there were added two new events setDefaults and setOptions. When all objects are constructed the events are called in following order:
- beforeInit -> Method is executed before inititialiation of this object
- init -> Method is executed to initialize object
- setDefaults -> Method is setting default class values
- setOptions -> Method is setting options passed as class parameters
- afterInit -> Method is executed after inititialization of this object
Framework also maps two new events which manage the change of application orientation according to the device orientation: onCanChangeOrientation, onOrientationChanged.
Also game part of the framework was enriched by new object: TextButton and a new function detach. The detach function is opposite of add function.
In application part of the framework were made some changes, too. Firstly the new property keyboardType was added to the TextBox. It affects the type of keyboard which shows when it is required by the control.
All changes and fixed bugs are available in the next list:
- Add setDefaults event to the base class
- Add setOptions event to the base class
- Scene becomes a single layer
- New detach function to Game object
- New onCanChangeOrientation and onChangedOrientation in Game class
- New TextButton, to display text and onClick event is fired when is clicked on the textButton
- Layer extends gameObject
UIX bug fix
- Application.ms bug fix, form undefined caused stack overflow if called via eval
- Bug fix base drawing, to make cloning of Drawing object working
UIX new features
- Add keyboardType into TextControl
- Modify application base control call control default within new base class event
- Modify application base drawing, to make cloning of Drawing object working