How do you get the name of the imagesprite?

I will set the text of a label to the name of a imagesprite.

I ask because there is no specific block to find.

Is there a code, a code like for example"\n" for ne line....

Because when I make it with the "get" and then changing to "component" I get only the large source code like "Google.(a long text).imagesprite908888775@blabla" but not the name....

You can not get the component name (set in design view) by block.

But you can use a dictionary to give the component a name ang get the name later.

And how to achieve this? Which block combination?

Perhaps as simple as

and you can get the name of the image you associated with the ImageSprite.
spritename

or

ANY ImageSprite displaying on your Canvas

anyImageSpriteName

or something like this:

Hello guys you are crazy lovely, thanks for the ideas and explanations, this is wonderful. Thanks thanks thank you guys..... Now because of you I have a lot of work to do but I mean this in a positiv way, thanks thank you guys.

Okay guys here is my plan: i want to enter all Sprites in a list (not in Alice.... :joy::joy::joy::joy::joy:) and give the Sprite numbers by join the number with the Sprite name to use this as the future Sprite name and when one of the Sprite touch the edge then a certain label is set to this information with the join (not joint) function or block and put together by join the Sprite name (what we was get earlier) the x-position the y-Position and which edge it's touched, the number of edge for example "West" = " - 3" and so on. That i can see which Image Sprite was touched, which edge, and on which Position.

And the new Sprite-names must go in a list, as global, that we can later work with this data, to have it when the certain sprite touches the edge to set the certain label with it.... For example left edge left label: w = -3 imagesprite new name... X = ... Y=...

This second formed information must also go in a list, global

Because the sprites will interact with each other...

But this later...

Status notification if you want it so...

This is the project

And this is the block to worked with:

"The Sprite new names list" as global.

I suspect it will work with the "for each item" block? But I n this case I m not sure how, and there I need your blessed help my wizards of magic...

And then in this block:

The setting to the certain Labels middlest the earlier taked list of sprites under new name an then the position and the other information for the Status notification.

Unlike the answers given above, is there a way to get the component name with the help of the extension, without using variables? Sample picture:

image

And what ist the name of the extension??

It is not a simple affair, the name is "re-generated" at runtime (as is the component) so the values have to be fetched at that time. MIT have worked up a solution, but it is on their very long list.

Much easier to just create a lists of lists of the components and texts.

And what is the name of this extension?

There is no extension!

Ok, here is what I try,

I want to make a list from every imagesprite, store it in the IMG Sprite-names, and then display it with the button (I named it ) "Sprite" . With the next line option, to see the progress from one sprite in the list to the last.
Here I send you the AIA file... For your better understanding...

leftedge_copy.aia (21.0 KB)

You do not add the actual sprite component name to the list?

You should name your imagesprites to match the text names being generated

Also, your naming procedure will need to be run each time the app is initialised, because the sprites are generated at runtime .

Ok, now I understand your cuestion, an no, I don't want to name the sprites by hand, I want to give them a number, name number combination , how? Everytime wenn a clock cycle starts, I want to clear the list, set the Sprite nr to 0, and let the for each loop fill mi list , like this: reakt that to the first imagesprite, from the "every imagesprite" block, see that there is a imagesprite, take tis imagsprite, and give them the name "sprite" , let the loop generate spritenumber +1 and then add this number to the spritename, and then save / add it to the list, and then access the "imagesprite list" and display for me the inside things in the "imagesprite list", and evyerytime that it displays the inside of the spritename list on the "spritebutton" and add a new line to the "spritename button" .

And here is my problem, how to access the spritename list, in the moment, before the next imagesprite is added, and set the button "sprite button" to the insides of the list by accessing to the "spritename list" , here is my next problem:

how to acces the "spritename list" in this moment and display the list insides one by one, but evertime add a new line to the sentence in the "spritebutton"

..... You understand my first problem now? And we was not able to use this list now, because, I want to solve first-time the adding-problem,

then the displayyng-problem for the "Sprite button" then the adding line to the "sprite-button" problem, and then make the step to take the next imagesprite from the "every imagesprite" block.

And all step by step, and timed by the for each loop.

And this inside the clock sycles, because when I add a imagesprite in the designer, it must reacting in time, and display the new changes in the list and in the button.

probably not...:wink:

You may want this?

Ok here, is my first cuestion: can the global spritenameslist get his data from the "every imagesprite block"?

You could, but your imageSprites may be returned in a order you do not expect.

In my simple example, the every block returns them in reverse order. This may not always be the case. You might name the 4th sprite created as imageSprite2, keeping track might be difficult.

Better to make a list.

But, just this is what I need in the first step, the program must from the every imagesprite block only know how much imagesprites there are, and collect them in a list, and in the second step, because we know how much imagesprites we have, then we ad to the list a new position for runtime-google-gibberish-name, we ad then the new generatet ( and for us understandable name) with the word sprite and number, or only the number, but not as completion from the google-giberish, but as a new position...

First make list from every imagesprite, for example we have 4 imagesprites then in the list will appear 4 Google-gibberish-things, and then for each of this thing we ad a new named name in the list, for the imagesprite like Sprite and number, logikaly we have then 8 objects in the list, what is no problem for me, because then we have the first step achieved...

Try it both ways, see which works for you the best.

Bear in mind:

You may name an image sprite in the designer, you will need to assess the runtime name of the sprite component to accurately provide a text name for that component.