How To Make Blocks Work

I know how to make blocks. But I don't how they work. So, I would like to know how they work. E.g. how to make a block which will say your username. I already know how to do that act using the blocks Snap! has though. Please note, I am asking if I made a block on Snap!, how could I make it do the work I made it for. Thank you.

I've seen a block for that, but I didn't click edit to see how he made it, but it's possible.

Username Block script pic

That will tell you the users username, but I'm not sure what you mean by the rest of your question. Hope this helps.

If I'm understanding the question correctly, you want to know how Snap! itself works. That's not an easy question, because Snap! is a large, complicated program.

First, Snap! is written in JavaScript. It'll be easier to understand Snap! if you learn JavaScript first. (If you know other programming languages in the C family, the ones in which you say "does this equal that" as "this == that", then you can sort of wing it and ask DuckDuckGo when you come across some piece of the language you don't recognize.)

Then, you have to read the Snap! source code. On the main site, down at the bottom of the page, in the About column, the last link is "Source code." Click on that, and it'll lead you to the Github repo. If you're not a git user, the easiest thing to do is click the "download as zip" button, which will copy everything to your computer.

Each of the Snap! source files starts with a long comment that explains what's contained in that file. Read those. Start with the extra-long comment in morphic.js, which is the main overview of Snap!.

I wish I could tell you an easier way, but I'm afraid there isn't one. But you don't have to understand it completely to have useful knowledge. I haven't studied anything about how the graphics actually happens; I'm mainly interested in learning how particular (primitive) blocks work. For that, search for initBlocks in objects.js and that'll tell you how to find the code that implements a block.

Actually, I know how to that. I asked if I made a specific block for that, how could I make it do the work.

Actually, I know how to that. I asked if I made a specific block for that, how could I make it do the work. Looks like you are having trouble understanding my question.

I am sorry, but it looks you all are unable to understand what I said. I asked if I made a block on Snap!, how could I make it do the work I made it for.

May I ask what your native language is? I wonder if we have someone on staff who can help you more easily. But it now sounds like you're saying "how do I use a block I've made," but that's too easy a question -- you just put it in a script same as you would a primitive block.

I don't wanna be rude. But you are driving me crazy! I am an Australian-Bangladeshi. So, I speak in both English and Bengali, half of both everywhere, even in my mind. And that sometimes makes it impossible for people to understand what I say, sometimes not always. So, I may have to rephrase it. So, please don't insult me like this!

And thanks for the information.

I didn't mean to insult you. I'm sorry if it sounded that way. I was just thinking that we have, for example, German users whose questions are sometimes hard for me to understand, so they talk with Jens in German instead. I guess I accidentally pushed some button for bilingual people without meaning to. Sorry again.


well im a american-indian

I see.

Use the getters and setters lib

I think I wrote that post before I knew about libraries

im trilingual