XFC v1.0 : Extensions For Codea [update 1.1][1.2]

@Andrew_Stacey i knew i woudnt make it up with your standards! :wink: But what would be the need to compute a rolling value if i update the display only every n frames? I dont want to update the display more often, for reasons iā€™ve explained above.

@Jmv38 I think i have a solution to your problem, but not a elegant one.

If you draw everything before the draw of the Project then maybe just adding a resetStyle at the end along with resetMatrix should do the work.

If you have already tried that, sorry!!

Thanks for the suggestion. But a resetstyle will erase user previous setting? So it will be annoying sometimesā€¦ I have to look.

@Saurabh iā€™ve uploaded a version 1.2beta1 that solves your text problem.

@saurabh an @codeanoob for nosmooth() it sould be restored by popstyle(), but it doesnt seem to work. If you put a smooth() at the beginning of your draw() it will work, sorry for that. @Simeon, could you have a look at that? If i am right, this is not compliant with the doc.

Note: to get the 1.2beta1, update to the 1.2beta0 this will add more install buttons, allowing to install the beta version.

If you do

pushStyle()
resetStyle()
--- your stuff
popStyle()

Then it should work.

Re FPS, yes, with those constraints then itā€™s a reasonable solution. But is that really so important? You could view the numbers as a collection of digits and display them as a set of strings rather than a single string. Then youā€™d be selecting from a small number of fixed strings which wouldnā€™t need continual creation and destruction. But I do wonder how much of an effect this really has. Have you measured it?

Pushstyle() i have done it, it seems to work with everything but the smooth(). I am not 100% sure because there is so much codeā€¦
FPS: your solution would work, but i am a bit too lazy to code that. I think i saw a real difference in the past. The memory kb were incresing very fast and i was surprised of that. And then quite often there was a small fps drop due to the garbage collector. Then i found out it was due to this string creation: i modified the way it is now and the kb increase became neglectable. Since my program is here to help, not to create fps drop for the user, i try to be as efficient as possible.

@Jmv38 while trying to download the update I am getting this error

error: [string "-- VersionMenu..."]:119: attempt to call method 'betaUpdate' (a nil value)

Is something missing? My current version is 1.2beta0

Could it be possible to have that X icon at the top, only available while running XFC and not running some other Project with XFC as a dependency?

I will check that

@Saurabh you are correct: i get the same error. In some sense it is good news: the update process works well, weā€™ve got the same version with the same bugsā€¦
I have uploaded 2 files:

  • stable update v1.2.
  • beta update v1.2beta2.
    The 2 files are identical except for the version, Download the stable version, it has all the improvements and let me know. Thanks.

Concerning removing the X: can you tell me what is the problem? Is it that it is not at the good location and you want to move it? The icon is smaller than the other buttons, so it is not really eating space. I can do what you request but i want to be sure i understand the need before doing anyhting.

@sairabh i have uploaded a v1.3beta0 where if you tap of one of the meters it hides the X. Tap again to bring it back. I think it will do it?
Iā€™ll make an update where this choice is saved (not done yet).

@Jmv38 Now that you say it, I do recall something about smooth not being respected in the pushStyle stuff.

Updated perfectly to 1.3beta0.

The X icon was on the CC icon. I donā€™t think we have the option to move the CC icon, do we?

Tapping the ā€œ?ā€ In meters Doesnā€™t hide the X, or were you saying that youā€™ll do that in the next update? I would still prefer an option to hide it rather than shifting it to some other position.

Tap the meters button (fps, ms etc) to close the X. and If you dont have any meter on the screen, just remove the dependancy to xfc!

Oh okay. I thought you were talking about the meters button. LOL. Didnā€™t read your post properly, sorry.

@Saurabh You can move the CC icon to wherever you like. Load CC then click edit. Unlock the button and drag it wherever you like!

I knew we could resize, didnā€™t know about thisā€¦ Will check it outā€¦

Thanks

Iā€™ve modified the beta to mask the X icon with long press instead of tap: it is better for first install. (not uploaded yet)