EDIT: Previously, this thread was the central place for asking Foxhole questions. However, Daniel has been kind enough to create an entire new sub-forum for Foxhole. Please feel free to create a new thread in the Foxhole section if you have questions or comments about Foxhole.
OLD Official Foxhole Components Q&A(286 posts) (47 voices)
Wow, so sorry about writing tldr. Did not mean to make it sound like that. Anyway I'll post up my UI components asap
First of all, I wanted to thank you for sharing your UI framework!
I have some performance issues with the components. I'm trying to do a simple test > ScreenNavigator containing two screens that holds a List with 10 items (ItemRenderer with Button) and a button to switch between the views/screens.
The ScreenNavigator is hooked up to a ScreenSlidingStackTransitionManager.
So, to begin with, it feels like that simple app is very heavy. it takes like 15/20 seconds for it to startup. once its started I can switch between screens like 2/3 times and than the app freezes, and that only if the lists have like 5 items, If I try it with 10, I get a Resource limit exception . I also tried it on IOS and it craches occasionally.
am I doing something wrong or it's just that the framework isn't stable yet?
Thank again Josh.
@JoeRose No, I've not encountered any major performance issues like that. Rest assured, if things were that bad, I certainly wouldn't have shared anything with the community yet. My game, Rivers of Olympus, has been out for a couple weeks now, and I would expect some feedback that says its crashy or super slow. On the many devices I tested on, it ran smoothly.
Does a Starling app without Foxhole start up in less than 10-15 seconds?
You said that you "also tried it on iOS". Where's the first place you tried it?
I suspect that you're using too many textures or that you're instantiating a bunch of objects in an enter frame listener or something like that. See what happens if you switch to a TextureAtlas and check for any runaway code.
Hi, thanks for your quick answer Josh.
Yeah, it does seem to me a little strange. However I'm doing a very simple thing here no, unusual stuff.
No, when I run an app without the framework it starts and runs fine.
I have only tried it on an IPad 2. I am using TextureAtlas, and it holds only a few images.
I have to say that when it does run, before it freezes, it runs smoothly.
Maybe i'm not implementing the ItemRenderer right. Does your list support recycling of ItemRenderers? maybe they're getting stuck in the memory.
I'm also testing it on the air 3.2 beta.
edit: found the problem. I was creating a new TextureAtlas inside each itemrenderer - not a smart idea
But, another question. I've noticed your list missing the "throwing" effect. Like when you swipe your finger the list should slide with an easing effect. Is there a built in way to accomplish that or I'll need to extend it?
Ouch. That many texture atlases will most certainly cause issues.
The list is supposed to have a throwing effect. Most of the lists in my apps are very short, though. The effect might be too weak, or maybe I changed something along the way and failed to notice that it broke the physics. I'll look into it.
I haven't found the time to look at the components yet, but what I've seen so far is really great! Thanks a lot for your hard work, and for sharing, Josh!
BTW, please add a short link to this thread in the list of user contributions:
Until I finally create that Sparrow wiki, this is the best way to have those extensions in a common place for users to browse. Thanks in advance!!
i guess many flex developers are watching the foxhole starling project very closely because you are missing only a few components to use it not only for games but for any mobile application. in the moment flex is (or maybe was) the "best" way to develop (non-game) apps for mobile devices in AS3 (even if they perform poorly).
i bet if you would add some kind of textinput-area, a datagrid component and do some polishing then your project could be the most popular minimal framework to develop exactly the new kind of apps where functionality and productivity is balanced with smooth performing eye-candy (i.e. like the actual calendar on the latest ipad OS).
i hope you find more time to spend on foxhole components because they look very promising.
grats & have fun,
@QuadWord I'm glad you're interested in Foxhole. If you've checked out the code at all, you've probably seen a number of similarities to Flex. I'm a long-time Flex developer, so I borrowed a many good ideas from there, while also trying to make things a little simpler.
A DataGrid component is very unlikely unless someone is willing to pay me to work on it. I don't need anything like that for the types of projects I usually work on. It's not particularly suited to most games and smaller apps either, which Starling and Feathers tend to be used for. It's a complex component that will require a bit more focus and maintenance than most, and my time needs to be spent wisely. Maybe in the future when the rest of Feathers has matured. Or maybe someone in the community can build one.
As for text input, I've been using StageText and placing a simple background texture behind it. I guess it wouldn't be too hard to wrap both up into a single component, but I haven't felt like I needed that yet. Maybe that will become more important later if I decide to add some containers with programmatic layout capabilities (not that I'm promising anything like that, just a possibility).
josh: of course you are absolutely right if you you continue to treat foxhole starling like the byproduct of your other projects (because it is). but as you can see it grows very popular and i guess at some point you could raise the question if foxhole components is not only a byproduct but a project of its own.
anyway i just wanted to point out that there is a huge demand for exactly this kind of framework and there is maybe a huge opportunity compared to your other projects because right now you are standing in some kind of spotlight and this could also help to moneytizethis project.
Been looking at the source some... Really digging it, can't wait to start using it. But first I'm needing to familiarize myself with Starling more.
I've yet to delve into GIT, but I'll try to fork it and document things along the way.
Would you be opposed to a default skin bootstrap? Seems like half the struggle getting started is a) understanding TextureAltlas, Texture, and other misc Starling specifics; b) setting up a TextureAtlas xml file, and associative images. I'll keep my eyes open for CC/MIT or otherwise freebie graphics to help expedite it if that's alright (or maybe could make a call for a skilled graphic designer to supply graphics? I'm ok with Photoshop, but I know there's better out there).
It's taking me a bit to get used to working in Bitmap graphics again after years of vector. :S
PS, I like seeing "this" used and _protected and _private member names. I felt alone for a while there
Don't worry, Starling is super easy to pick up. You mainly just need to learn the texture stuff.
I have a "kitchen sink" sort of app in the works. Mainly, I'm going to use it for testing to ensure that nothing breaks when I make changes. However, I think it'll be a good source of sample code too. Anyway, it's likely to include a super simple default-ish skin.
Honestly, I'm surprised that no one has ever complained that I use
thiseverywhere. I know some developers hate it, but I think it's one of the most important parts of readable classes.
I have tested your components right now using your new examples and following you can find my results on the new Ipad retina.
Tomorrow I will test them on IPad1 and on some Android devices.
when I scroll the list I got about 30/34 fps.
I have tried your default demo that show only 3 items at time.
It could be accettable but I think the fps will decrease a lot if I try to show more than 3 elements at time.
Furthermore on Ipad1 and old Android devices the framerate could be less than 10/12 fps.
1) If i touch the screen and I start to move the list I only get about 9/10 fps.
So I think on IPad 1 the framerate could be about 1/2 fps :°(
2) there is a little bug: if I scroll the pickerlist, the last item is automatically selected after the release of my finger. So I can't scroll more than once.
I have the same issue when I test your demo on my desktop with a dual touch display (HP 2310)
Note: the picker list works perfectly when used with few items (just like you did in the control panel of the Slider demo). In this case it's great and very useful!!!!
SLIDER, TOGGLE SWITCH, BUTTON:
seems ok. 60fps and no issues.
ABOUT THE LIST FRAMERATE:
I got the same fps issue trying to do a scrollable list using simple TextField items.
I don't understand which is the best way to create this kind of component getting a good fps result on new and old devices too (just like Ipad1).
Thank you very much for your components!
Thanks for the feedback, Fabio. I hadn't yet tried the latest code on iOS. I'm surprised to hear that the PickerList closes like that. It works correctly on Android and Windows. I'll investigate and try to fix it soon.
The low framerate on the list may be due to the fact that clipping is enabled in the demo (I never use that feature), or maybe I need to optimize the way I set data on my item renderers. Maybe a little bit of both. I have some good places to start investigating.
The PickerList closing bug has been fixed. You should also see increased performance for all list scrolling. It's much smoother on my iPad 1, but I didn't specifically check the exact FPS.
Hi Josh, thanx for the patch.
So here some test on Ipad1 and Ipad3.
I forgot to say you that on both devices, IPad1 and 3, I can't see the transitions between scens(while I see them on desktop)
1) BUG FIXED: great : )
2) PERFORMANCE: better!
I get about 30/40 fps for simple scroll (touch and quick release) and 18/20 fps if I repeatedly scroll up and down.
1) FPS: it depends, from 18 to 35 fps
2) Another little bug that often occurs (not always): sometimes I scroll down until the end but the list remain blocked on the last item (#50) and I can't scroll anymore.
IPAD 1 - IOS 5.1
(I have resetted it few hours ago, so it's an empty device)
In general the UI is less responsive than Ipad3 and I don't see transitions between scenes. When I click on a button I have to wait few ms before doing the action.
Nothing so bad but I want you to notify it.
No good news: 8-10FPS
1) As I said before, when I click the Picker list button I wait about 0.3/0.4 seconds, while on Ipad3 is immediate. It's not a problem but the application could be seems not so reactive.
FPS when I do nothing: 22 fps <--- no touch, no movement, nothing!!!!!!
FPS when I scroll: 7/9 fps
@Josh, most excellent!
I'll be playing with these over the next few days.
Just got the Example and Minimal theme project set up and running, few things standing out, but I'll wait until I can play with them more to comment on any issues.
Oh, and if it's ok, I'm going to be adding function comments, and sometimes some line comments... At some point I'll try to learn enough git to commit and do a pull request.
@fabiobiondi (and anyone else who is interested) Please take a look at the latest update with more performance improvements. I can now see screen transitions on iPad 1 (the framerate isn't perfect, but it's still better than no transition). List and PickerList scrolling framerates have improved too.
@Josh, thanks for the kitchensink.. I've been messing with it quite a bit, trying to make my own skin (I can't stand the minimal comps look).
For some reason, I can't seem to get the scale-9 grid working right, and I think it *might* have to do with my texture.
A) What's the format of it? I was thinking it was (from looking at the source) left, top, "center width", and "center height"
B) If I'm making a pill-button, this doesn't exactly work, does it?
Something akin to this: http://bit.ly/GYkrpM [not my texture, but gets the point across]. Since there's no "center" to speak of, I'm imagining that this texture type won't work? Or am I just going about this wrong?
Hi! Please add D-pad control
A) Yes, x and y are the width and height of the top-left region, while width and height are the dimensions of the center region. All other regions can be determined based on those values. I think that's how scale-9 rectangles work on the classic display list, right? I just went with what seemed most intuitive.
B) I haven't tried a pill button. Can you make the center region width and height equal to zero?
I'm traditionally a Flex guy, with a LOT of dabbling in Flash. Alas, I haven't done scale-9 in pure Flash aside from what the IDE implements for you for MovieClips.
Flex syntax I'm used to:
[Embed(source="someImage.png", scaleGridTop="25", scaleGridBottom="125", scaleGridLeft="25", scaleGridRight="125")]
Basically marks the 4 lines to calculate slicing from.
As for setting the w/h to 0 for center region, I did try that, and this is the result:
I've included the original texture PNGs as well if you wanted to play with them. If not... I'll figure it out at some point... I'm wasting a ton of time playing with piddly stuff like this
****** EDIT ******
It literally just dawned on me... it makes NO sense to scale9 a pill button. I actually want it to scale plainly. Uh-duhhhhh. Otherwise it just becomes a rounded rectangle! The gallery is updated with working example, where I set the w/h to 1
I'm going to re-think my buttons... move to a scale-9 approach.. too tedious to figure out scaling of an image for every button, and it's not looking too clean anyway
Yeah, I think if you want to keep a pill shape (with a stretching center region, but the two sides remain as semi-circles), a scale-9 solution isn't what you're looking for. Something very similar, I think, but the semi-circles need to be able to scale on both axes to remain circular.
You have me thinking again... I might modify the scale9 to a scale3
but for now i'm gonna stick with the MinimalTheme you've provided to get something out the door.
Curious, the default DPI you have is 326, how did you come up with that? When I set it to the [what I] expected (since I'm on desktop), 72, the viewport goes all insane out of whack. Trying to wrap my head around the scale calculations you have sprinkled throughout.
**** EDIT ****
Umm.. ignore that last part... I just did a git pull of the foxhole-starling and -examples project, and now fonts are jacked... lookin to see if I missed something
960x640 with 326 DPI is iPhone retina.
Ah cool. Makes sense then.
Quick question, on the PickerList, is there a feature for when a user selects the item, it resizes the Button/PickerList to the size of the label?
A spin-off question: Would it be feasible to iterate over all the itemRenderers and find the longest width?
I wanted to avoid iterating over all the items in my array for every PickerList to find the longest string, and use it as the TypicalItem. I suppose I could extend all the classes (PickerList, List, ListDataContainer), but that seems to be a pain :S
Any ideas? For now I might just size it what I might expect it to be... But when users start entering data, the items might extend my expectations.
Also, am i the only one seeing weird font issues since the last git pull? http://i.imgur.com/2NhSM.png
I should probably support a typical item in the PickerList so that the button is sized to that. I should probably also look into adding some clipping when label is longer than the available space.
Since List uses a virtual layout, only some of the item renderers are created at any given moment, you would only be able to find the longest width of those that are visible. Typical item is there for this purpose. It doesn't need to match an actual item in your data provider, though.
The weird font issues might be because I removed all pixel snapping. That was a big mess and a bad idea. However, maybe I need to give Labels an option to snap so that pixel fonts don't look funny.
You must log in to post.