starling-framework

Starling game resolution in multiplataform

…衆ロ難τιáo~ 提交于 2020-01-03 04:18:11
问题 We're building a game in starling, and we want it to be multiplataform, but we found some problems with resolutions, we have designed the game for iPad, and we want it to run in samsung galaxy tab 10.1 and iPhone, The problem we have in SGT 10.1 is that we want to center the content and add an extra background to fix the black tires in the sides, and in iPhone 4, the content is bigger that the screen... do you know a way to solve it? Thanks 回答1: Here is a link that explains how to develop for

Starling library - Sprite dissapeared from stage and I don't know why

匆匆过客 提交于 2019-12-24 21:44:47
问题 The code for the question is here - I am using Flash Builder 4.7, I will also post all the relevant code now: Game.as (might be something wrong here) package { import Classes.AvatarEnemy; //import starling.animation.Juggler; //import starling.core.Starling; import starling.display.Sprite; import flash.geom.Point; import flash.display.Bitmap; import flash.display.BitmapData; import flash.ui.Mouse; import flash.ui.MouseCursorData; public class Game extends Sprite { //private var juggler:Juggler

Starling library - When I try and change cursor to image…it doesn't work (and a sprite element dissapears from stage)

こ雲淡風輕ζ 提交于 2019-12-20 06:38:12
问题 I am using Starling to make a really, really, really easy game - I am just trying to add a stationary sprite to the stage...and make it so that when the mouse touches the sprite...the game "stops" and a score is sent. I haven't tried implementing hitTest yet for the collision, but I have run into a sort of conflict problem where, when I comment out the line(s) that is supposed to change the cursor image (see Startup.as - stage.addEventListener(TouchEvent.TOUCH, touchHandler); and

Starling on iOS - Touch event handler “dies off”

别说谁变了你拦得住时间么 提交于 2019-12-11 21:22:23
问题 I have a method that applies force to a ball in Box2d. Testing it locally on desktop it works fine, but on iPad (ios7) the method get executed only until the half! I never came accross such a weird error, what is wrong here: function onTouch(e:TouchEvent) { var touch:Touch = e.getTouch(this) as Touch; if (touch && touch.phase == TouchPhase.ENDED) { //do something _debugT.text = "works"; var mouseX_m:Number = touch.globalX; var mouseY_m:Number = touch.globalY; _debugT.text = "stops here...";

Starling TouchEvent on Sprite

浪尽此生 提交于 2019-12-11 14:24:05
问题 I have some images/sprites/buttons (i tried them all :)) scrolling/moving on the stage. The user has to tap them to remove them. The problem is that the touchevent does not match the position of the image. The faster the touchable sprites move, the further the distance between the touch and the actual image. i.e.: a image is moving across the screen with 20px/frame: Touching the image triggers nothing, touching 20 before it triggers a touch on the image. when image is not moving, this doesn't

“Wrong wmode value” when using Starling with an AVD

匆匆过客 提交于 2019-12-11 08:53:28
问题 I am currently using FlashDevelop set up with the Flex/AIR SDK and Starling. I have used the AIR for Android AS3 template and have successfully compiled test applications without initializing Starling perfectly fine. These applications run fine on my Android Virtual Device. But as soon as I initialize a Starling instance, the error "This application is not properly embedded (wrong wmode value)" shows up in a red bar in the middle of the screen. I've looked through the Starling forums and have

add MouseEvent.CLICK to starling image

笑着哭i 提交于 2019-12-11 04:01:28
问题 i have a container have many image with scroll , i add TouchEvent.TOUCH as event listener instead of MouseEvent.CLICK , because starling doesn't support MouseEvent . the problem is when i navigate between images it will listener to TouchEvent while i don't need to this ? is there any solution instead of TouchEvenet ? the code : private function onComplete (event:flash.events.Event):void { bitmapData = Bitmap(LoaderInfo(event.target).content).bitmapData; var newImage:Image = Image.fromBitmap

Scaling for Android devices with starling causing some layout issues

♀尐吖头ヾ 提交于 2019-12-10 10:54:12
问题 I'm using multi resolution technique number three as written in this article and to determine the scale factor and stage size, I'm using this piece of code originally written by Jeff : if (Capabilities.screenDPI >= 200) { if (Capabilities.screenDPI >= 280) { AssetFactory.contentScaleFactor = 2; } else { AssetFactory.contentScaleFactor = 1.5; } } else { AssetFactory.contentScaleFactor = 1; } var mViewPort:Rectangle = new Rectangle(0, 0, stage.fullScreenWidth, stage.fullScreenHeight); mStarling

Objects saved in a shared object are not keeping their data type after restart. Any ideas?

柔情痞子 提交于 2019-12-08 07:49:05
问题 I'm having issues saving, then retrieving sharedObject data. For example if I make a shared object: var myData:SharedObject = SharedObject.getLocal("myData"); Then, I make an object, in this case, a "feathers" listcollection object var lc:ListCollection = new ListCollection() then assign it: myData.data.lc = lc; ok now, if i don't restart the phone (i'm working on android) and I assign the saved listCollection to listCollection var and it works fine like this: var lc:ListCollection = myData

Starling game resolution in multiplataform

僤鯓⒐⒋嵵緔 提交于 2019-12-07 16:27:22
We're building a game in starling, and we want it to be multiplataform, but we found some problems with resolutions, we have designed the game for iPad, and we want it to run in samsung galaxy tab 10.1 and iPhone, The problem we have in SGT 10.1 is that we want to center the content and add an extra background to fix the black tires in the sides, and in iPhone 4, the content is bigger that the screen... do you know a way to solve it? Thanks Here is a link that explains how to develop for multiple resolutions in starling: http://wiki.starling-framework.org/manual/multi-resolution_development If