Hey ya'll. Really sorry if this is a common topic, but I'm having issues with spawning in an image. I'm trying to make it so that when an image is clicked a picture will spawn in.
If you can help, it would be greatly appreciated. Thanks!
On your screenshot the object is created when "createfac" button is clicked.
If you want to change it so that it gets created when another sprite is clicked, add Mouse object to your project and use "Mouse On Object Clicked" condition.
I may be confused here. I added in the mouse, but am I supposed to add it being clicked a condition underneath the button? If so, I cant seem to find the way to do that.
You need to delete the "Button on clicked" condition from the event. And add another one instead - "Mouse On Object Clicked".
Or do you want to trigger this event when either a button or a sprite is clicked? In this case the easiest way is to make two events. A more advanced method is to right-click on the event and convert it to OR-block. Then you'll be able to add both conditions to it.
I'm trying to make it so that once the button is clicked, the sprite will spawn next to it. I tried all of the methods, but I still can't do it.
Instead of fixed coordinates (87,425) use button's X and Y coordinates.
On Clicked Button : Create Sprite at (Button.X+100, Button.Y)
I am still somehow having problems. Here is a screenshot of my event sheet.
Develop games in your browser. Powerful, performant & highly capable.
You need to explain what you mean by problems. What exactly is not working?
I am simply unable to create a sprite when I click a button.
Check if the event sheet is attached to the layout, in layout properties.
If this doesn't help, please post your project.
That was my issue, thank you very much.