abi>>forums (http://www.anythingbutipod.com/forum/index.php)
-   Zen X-Fi2 Applications & Development (http://www.anythingbutipod.com/forum/forumdisplay.php?f=221)
-   -   ZenFrame - An application framework for the Creative Zen Xfi2 (http://www.anythingbutipod.com/forum/showthread.php?t=70975)

jbob182 10-28-2012 07:43 PM

ZenFrame - An application framework for the Creative Zen Xfi2
ZenFrame is a framework that allows for cleaner, more organized, and faster application development.

Download: https://bitbucket.org/jbob182/zenframe
  • Click the (download) link on the overview page. It is next to the Size entry on the table which is located on the upper-right
  • You can also go to the Downloads tab, and click Branches then the zip link
Wiki : https://bitbucket.org/jbob182/zenframe/wiki/Home
How to use
  • Config.lua stores the application information.
  • Screens are a way to divide up the ui into several files in order to make it more readable and easier to debug and edit.
  • The Resources library will automatically mange images/sound, so there is no need to manually unload them and clean ram when using this framework.
  • Texture Packs can be made using gdx texture packer. Please note that the zen has a height limit on images, (around 512 I believe)
  • Better documentation
  • Create a collection of user-made libraries
  • Keyboard library

Redwolfhome 10-29-2012 11:40 AM

This framework looks great. I love the screens, texture packs and all of this small useful functions. Maybe you could include templates for buttons, checkboxes, ... just a few ui elements in the next version. Maybe they can allow me to choose a image and then your franework handles the user input and drawing of my elements...

jbob182 10-29-2012 10:56 PM

Version 1.1 released. This update includes a UI library, which will automatically manage buttons and other ui elements. See the wiki page for more documentation. If you wish to see a better example on how to use this framework, check out my Graphing Calculator , it uses the newest version of the framework.

jbob182 10-30-2012 08:15 PM

It seems that the TexturePack parser is crashing, but only on the Zen. As of right now I have no idea why. It might be because of the file path that is used, but I am not sure. If anyone has any theories it would be greatly appreciated (I am running out of ideas).

Redwolfhome 10-31-2012 01:07 PM

Hmm I am not sure if this bug causes the crash on the zen but I downloaded your newest version and it crashed for me in Resources.lua in drawImageRegion
because imageArray[imageID][id] was nil.
I fixed this problem for me with

if (imageArray[imageID][id] ~= nil) then
        imageArray[imageID .. '-file']:draw(...

and then I got this error message from your framework


------Reason:The region button does not exist
Lua Run Error : [string ".\ZenFrame/ErrorHandler.lua"]:41: STOP

So your framework can not find the button region but its in the ui.pack file..
I will try to find now the source of this bug..

Redwolfhome 10-31-2012 01:54 PM

I fixed my problem. In TexturePack.lua you used an variable in parse() which is called "argument". The content of this variable starts with two spaces. So i just used a trim function:


function trim (s)
  return (string.gsub(s, "^%s*(.-)%s*$", "%1"))

And changed one line:


local argument = trim(line:sub(0,line:find(':')-1));
And the code runs fine for me (i haven't tested it yet on the Zen)

jbob182 10-31-2012 03:56 PM

Oh...... The version I uploaded that line was removed for testing purposes (I had it in there originally).

Also, to help avoid these upload issues and to make versions easier to manage, ZenFrame is now hosted on BitBucket through git, along with a wiki and an issue tracker which anyone can post on (https://bitbucket.org/jbob182/zenframe). Currently, I have bit bucket using the ZenFrame folder used by the simulator, so the correct version will always be uploaded (the current version has the trim line).

Also, crashing has been fixed on the Zen, the atlas-image used was too big (Not sure why, it is not too big on the x axis nor the y axis, it could be a combination of both)

All times are GMT -5. The time now is 06:04 AM.