I have a question…
How doi add categories to snap! Through code?
Javascript so nobody gets confused and by javascript I mean snaps source code
You can add a category by hand, through the File menu.
AFAIK you can’t add categories using Snap! code (so categories are not truly “first class”). You can read them programmatically, through .
If, as I have understood by now, you’re really hinting at changing Snap! ‘s source code, I’m afraid I can’t help you, since I’m not knowledgeable on that subject.
You’re welcome.
Im in snaps source code I’m talking about javascript
Ok thanks for the help anyways
I made the category but it doesn’t show unless I turn on single palette? I’m stuck and I need someone to help
you have to add it to the code that shows the category buttons (it's in gui.js)
How?
Can you maybe be more specific and provide me the line number? And more instructions?
Wait is it at 1547 the addcatgeorybutton function?
looking at the github repo master branch (which is the dev version), the key lines are 1757-1762, 1767, 1789-1790, 1796-1797 and maybe 1606 (number literals 4, 6, 8, 3, 5, and 7 are often key bits)
I just need to put my test category in the correct position cuz it’s there it’s just under the palette all I need to do is modify the layout somehow
having it show requires editing the lines i gave, and having it show in the right spot in the categories might require specific placement of its thing in the SpriteMorph.prototype.categories list
Well I’m not using the dev version and I can’t cuz then I would have to move the parts of code from the previous version and it will took me a long time to transfer it
just look at the lines i gave in the dev version and find the corresponding lines in whatever you have
I just can’t figure it out I can’t find it
FOUND IT! Yes