Deleting a sprite without completely removing it?

For questions about using Classic.

Post » Tue Mar 03, 2009 3:20 pm

I realize this must be the dumbest question on this entire forum but I just can't find the solution.

I have a sprite in my layout that's only supposed to be created at runtime. If I delete the sprite it gets removed entirely from my application. I just don't want it on my screen at start-up. How do I get rid of it?

Cheers
B
1
G
3
Posts: 3
Reputation: 831

Post » Tue Mar 03, 2009 3:27 pm

[quote="asker":2wrqgwhr]I realize this must be the dumbest question on this entire forum but I just can't find the solution.

I have a sprite in my layout that's only supposed to be created at runtime. If I delete the sprite it gets removed entirely from my application. I just don't want it on my screen at start-up. How do I get rid of it?

Cheers[/quote:2wrqgwhr]

That's the pain, but you have to keep it on outside the layout, and deactivate it on the layout start in the events sheet.
However i would prefere to to have global objects that you don't have to keep on layout.
My professional Royalty Free Music at Scirra Assets Store
--------------------------------
Specs: i5 2500, 16gb of ram, gtx 770, win 7, Focusrite Scarlett 8i6, Mackie mr8mk2, Alesis 320, browsing the net on chrome.
B
71
S
19
G
19
Posts: 1,919
Reputation: 16,910

Post » Tue Mar 03, 2009 3:42 pm

Tick the 'destroy at startup attribute'.
B
3
S
2
G
5
Posts: 1,777
Reputation: 5,529

Post » Tue Mar 03, 2009 5:06 pm

[quote="megatronx":2vkdcz84]That's the pain, but you have to keep it on outside the layout, and deactivate it on the layout start in the events sheet.[/quote:2vkdcz84]

No!

[quote="Rich":2vkdcz84]Tick the 'destroy at startup attribute'.[/quote:2vkdcz84]

Yes!
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Tue Mar 03, 2009 5:37 pm

[quote="Rich":v8myvju5]Tick the 'destroy at startup attribute'.[/quote:v8myvju5]
Ah, didn't notice that one. A working solution I suppose, though I'd really prefer being able to remove it from the layout.
B
1
G
3
Posts: 3
Reputation: 831

Post » Tue Mar 03, 2009 5:43 pm

If you want it in your game, it has to exist somewhere. The layout is pretty much the only place it can exist... so what do you suggest?
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Tue Mar 03, 2009 5:52 pm

You can tick the eye thing of the layer to make the layer hide from view, thus hiding everything on the layer so you can work on stuff below.
B
62
S
21
G
12
Posts: 1,910
Reputation: 13,155

Post » Tue Mar 03, 2009 5:59 pm

Why would you want to remove it? What if you then need to edit it or its properties?
B
3
S
2
G
5
Posts: 1,777
Reputation: 5,529

Post » Tue Mar 03, 2009 6:05 pm

[quote="deadeye":1mxjcgzl]If you want it in your game, it has to exist somewhere. The layout is pretty much the only place it can exist... so what do you suggest?[/quote:1mxjcgzl]
You know how things exist in the layout without being on screen, like the Mouse & Keyboard object? Something like that. If the object is created (or spawned) somewhere in the event list it shouldn't have to be in the layout, but perhaps it's just a matter of habit.

[quote="Rich":1mxjcgzl]
Why would you want to remove it? What if you then need to edit it or its properties?
[/quote:1mxjcgzl]
It's just that I like things clean and don't want anything on the layout other than the things I want there at the start of the frame. I understand it's not a REAL issue since the object will never be visible in the game. It's just something stuck in me, like how you structure your code in regular languages.

Editing the properties of an object not in the layout should be possible (EDIT: is already possible) via the objects-list to the left of the layout screen.
B
1
G
3
Posts: 3
Reputation: 831

Post » Wed Mar 04, 2009 11:35 am

If you are really concerned about keeping a layout as clean as possible, I'd take the advice above and make a layer which is hidden to put it all on, or place it as far offscreen as you can.
B
3
S
2
G
5
Posts: 1,777
Reputation: 5,529

Next

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 0 guests