Starling has higher rendering performance than OpenFL,
But I tested that the performance of “openfl tilemap” is much higher than that of “starling movieclip” in rendering,
Can we optimize the rendering performance of ‘Starling’ to match that of ‘OpenFL Tilemap’?
I believe this is everyone’s expectation ..
There is no way to make Starling render images/movie clips with the same kind of performance as TileMap
But we can make some kind of TileMap for Starling, and this is exactly what I’ve been working on lately. I still have some work on it before I release it publicly, mostly writing a bit of documentation.
If you feel curious, it’s here : GitHub - MatseFR/massive-starling: custom starling DisplayObject for heavy rendering
Hello, may I ask if Starling supports “mouseOver, mouseOut” in the HTML5 target on mobile devices? I often use these two events to create button effects on the AS3 computer. I would like to ask if Starling supports them in the HTML5 target on the mobile phone. If not, how can I achieve such effects? Thank you
The Starling equivalent of mouseOver and mouseOut is TouchPhase.HOVER. However, this phase is generally not available with touchscreen user interaction.
That being said, if someone were to connect a mouse to a mobile device via USB, it should support TouchPhase.HOVER.
That’s a good point @joshtynjala.
Also, the AS3 / OpenFL MouseEvent.MOUSE_OVER has functionally the same shortfall as Starling’s TouchPhase.HOVERon a touchscreen device. You have to be touching the screen to register the event, it’s not like a mouse on a computer which can hover.
On touchscreen, there is no hover, there is really only touched / untouched for basic button animations. So in Starling, that’d be TouchPhase.BEGAN, TouchPhase.ENDED.
In Flash / OpenFL, the equivalent is MouseEvent.MOUSE_DOWN and MouseEvent.MOUSE_UP.
See details here @785597448
First of all, thank you very much for your responses. I am currently creating an HTML5 action game with the goal of using HTML5 for mobile devices. Since there is no keyboard on the phone, I use four buttons to control the movement of the game character. Clicking the button to move the character and releasing the button to stop it is really simple. However, the phone is a touch screen, and if the player holds down the button to move the character, they will not release the button but move their finger out of the button range. This is why I need “mouseOut” to turn off the movement, but it seems that there is no “mouseOUT” on the phone. The above is my idea
So let me ask everyone, first click the button to move the character and release the button to stop the character from moving. I have done it, but the phone is a touch screen, and if the player holds down the button and does not release it, their finger will move out of the button range. I need to turn off the movement of the game character. In AS3, I used “mouseOut” to turn it off, but it seems that the phone’s touch screen does not support “mouseOut”. So, I would like to ask if there is a better way to control the movement of the game character with buttons? Can everyone share their experience? Thank you.
Scroll down a little further in that article I linked @785597448 :
Although, this looks like it might relate more to an “up” / “hover” state. I’ll run a quick test to try and confirm what you’re after.
It seems the default behaviour is that the TouchPhase.ENDED event isn’t fired until the finger/mouse is lifted, even if while it was pressed, the user drags away from the button.
So the touch continues even if the user slides their finger sideways off the button, but is still touching. Once they lift their finger, whether still on the button or not, TouchPhase.ENDED fires.
var button = new MovieClip(assetManager.getTextures("someButton"));
addChild(button);
button.addEventListener(TouchEvent.TOUCH, function(e:TouchEvent) {
var touch:Touch = e.getTouch(button);
if (touch != null) {
switch (touch.phase) {
case TouchPhase.BEGAN:
trace("TOUCH BEGAN");
case TouchPhase.ENDED:
trace("TOUCH ENDED");
}
}
});
I have confirmed this on the HashLink and HTML5 targets. In the case of HTML5, I was using simulated mobile touch.
Ok I played with something new today ![]()
It’s a feature that was added to Starling in 2020, right when certain global events pretty much destroyed the industry I’d been working in, so this feature slipped past me.
ButtonBehaviour
var myButton = new MovieClip(assetManager.getTextures("myButton"));
addChild(myButton);
var buttonBehaviour = new ButtonBehavior(myButton, function(state:String) {
switch (state) {
case ButtonState.UP:
myButton.color = 0xFFFFFF;
trace("UP!");
case ButtonState.DOWN:
myButton.color = 0x888888;
trace("DOWN!");
}
});
It correctly handles button up, when you’ve pressed a button but then slide off it while still pressing. That is: it releases the button.
forum went down yesterday when I was about to reply ![]()
I’d go with Bink and recommend using Button/ButtonBehavior
I’m not into mobile much, but another possibility would be to let the user touch “anywhere” (or some area) on screen, record the x/y touch location and as long as that touch doesn’t end checking the x/y touch location every frame : if it’s to the right comparing to the starting x location, move right etc
My nephew has a gamepad device he plugs on his mother’s phone to play, so you might want to support GameInput too and only have the virtual pad when no real pad is connected
