There were a lot of remarks about missing button library. And i needed one, again, for my hand writing project. So i decided to make a quick, simple buttons library that is contained in a single tab, editor and data saving included.
Here is a video on how to install and use the library:
I have gisted it there https://gist.github.com/JMV38/8606537
@Jmv38 that’s looking very nice, I’ll test it out, tho i don’t think i’ll use it in projects of my own since I prefer doing everything myself ;p
Tho this is a very nice job you’ve done, keep up the good work ;p
@Jmv28 Great looking button class! I just skimmed through the video and havent had a chance to play with it but can colors be changed? I do feel like everytime i need a simple button I end up recreating a button class. This looks like it will fill the gap rather well. I do use Cider for larger projects but this is smaller a light weight
@Briarfox yes you can change about everything from the embedded editor panel:: color on, off, font, font color, size, inner marging, radius of corner, shadow size. I have not shown the details in the video. You can also delete the buttons from the panel.
There is also a ‘copy last change to all buttons’, ‘copy the style of this button to all buttons’, ‘autosave changes’
@stevon8ter i understand your point. But you are not recoding Codea built in functions, right? My dream would be that this library be good enough for users so it could be codea-embedded. But we will see what is the user feedback…
@Jmv38 if this library maybe extends, I might use it who knows ;p
Edit: I’ll probably use it for testing stuff, I yet have to decide if I should keep them or not ;p
hello! I have added ‘fire button’ types for dynamic buttons in games.
I have put the code on CC but i dont know how to get the link… Anyone can tell me how it get the CC link?
@Jmv38, when you have shared a project, go to your projects, select the one you want to share, and in the versions, you press and hold the version number (Alpha/Beta X.X.X) and it select copy.
@JakAttak thank you. That worked!
Quick video to show the improvements made today (refinements in the look and behavior of buttons)
@Jmv38, Do you have a jailbroken device? If not, what do u use to record your screen?
@codeanoob yep, cydia is my friend.
Nice project! Thank you for sharing.
@Jmv38 +1, nice button behaviours I like the sliding left to right.
@Jmv38 how you you recommend going about setting up buttons for multiple screens? I’ve loaded buttons and disabled the visibility and enabled them when on a screen that uses the buttons, but editing them is getting a little tricky. It would be nice if you could set button groups and edit a specific button group with the editor while all others are off.
@Briarfox good point. I 've just added a version with groups on CC. I’ll look at how to do what you want.
@Luatee same for me! The result start to look better than what i expected at the beginning.
@Briarfox done! It is v1.7 on CC. Now you can toggle group visibility from the menu:
0 : all buttons visible.
1 ,2 etc : only the group with this number is visible.
Groups are defined by a number. Make sure they follow each other with no hole, cause i use #groups in the slider.
If you want to show a single group g from code, You can use
Buttons.toggleGroupVisibility(g) . And if you want more complex mix, just use the
myButton.visible boolean property.
@Jmv38 Thanks! That was fast. I’ll talk a look at it later this eventing. I had been using myButton.visible but being able to toggle a buttons group visibility is awesome! I’m really likeing this button class.
@Briafox good. I’ve been really surprised how fast i could add functionnalities. I’ve learned a lot with XFC rewriting, and now this is so much easier that it seems quite easy! Maybe i’ve finally got this ‘object programming’ twist that make it easier.
Also note that you can move a group of buttons at once. That make the layout a much pleasant process.
@Jmv38 It seems that if you delete all buttons then there is an error thrown involving the length of groups. I havent looked through the code but I would guess that it’s trying to check the length of groups which would be 0.