Copy vs Clone sprite object

Discussion and feedback on Construct 2

Post » Thu Dec 18, 2014 1:54 am

Hi,

Is there any difference, regarding memory, between copying or cloning a sprite object ?
If I have a static sprite object that I need some copies of it should I copy or clone it ?
Thanks.
B
5
S
1
Posts: 22
Reputation: 417

Post » Thu Dec 18, 2014 2:18 am

Copy is an instance, and uses no new video memory.
Clone is a duplicate of the object.
A brand new different object.
Image ImageImage
B
169
S
50
G
174
Posts: 8,330
Reputation: 110,804

Post » Thu Dec 18, 2014 4:58 am

I've seen a lot of people get confused over that (I know I overlooked the difference in the early days...)

Newt pretty much explained it. Here's one additional bit of info though:

The way clone works in C2 is a little odd: all your properties are reset to default in the cloned object. This makes certain objects very frustrating to 'clone'. For instance, cloning particle objects means you have to reset ALL the properties, all over again.

So, if you are wondering why clone isn't working, it's not just you. :mrgreen:
Don't lose your work. Backup your game with Dropbox.
B
44
S
10
G
10
Posts: 1,106
Reputation: 9,202

Post » Sat Apr 01, 2017 9:50 pm

I know this is an old post, I searched and couldn't find a newer post or one with an answer...

Is their a simple way to duplicate an object in the project, in order to make a copy and not a clone.
I know how to clone, but it adopts the variables and I'm not wanting that.
I am just wanting a duplicate object independent of the other.

I know it is simple to just make a new object.
Mostly out of curiosity I was wanting to know a keyboard or mouse shortcut. It would be useful if it exists.
B
65
S
37
G
13
Posts: 240
Reputation: 12,703

Post » Sat Apr 01, 2017 10:58 pm

@Unconnected

If you mean make another instance (with same name, variables, etc) then, you can hold down the CTRL key on the keyboard, and then click on a sprite/object and hold the mouse button down and drag an new instance of the object to a new location.

Another way is to right-click on an object, choose copy, then paste a new instance.

Right-clicking and choosing Clone object makes a separate object (new name, but same variables, animations, etc - as you know)

If you mean a new object (with a new name) that looks the same, but not with the instance variables and animations, then you have to start from scratch.
B
97
S
34
G
20
Posts: 438
Reputation: 17,790

Post » Sun Apr 02, 2017 12:04 am

I was meaning a new object with a new name and no variables.
Was only wanting a shortcut. It is easy to just remake, so I will just continue doing that.

Thanks :)
B
65
S
37
G
13
Posts: 240
Reputation: 12,703

Post » Fri Apr 21, 2017 2:03 am

Clone is best I think than making a new object. Clone at least keeps something from the original objetct.

Am I right?
B
21
S
5
G
1
Posts: 13
Reputation: 1,729

Post » Thu Jun 01, 2017 3:02 pm

Unconnected:
I was meaning a new object with a new name and no variables.
That's a clone. It uses new memory since it is a new object as Newt said. Copy does not use new memory since it is an instance. At least it is how I understand it.

    For a copy:
      on stage
      ctrl drag
      right-click copy
      select copy/paste

      in project window Object type
      NA
    For a clone:
      on stage
      right-click and 'clone object type'
      in project window Object type
      right-click and clone
B
8
S
1
Posts: 86
Reputation: 618


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 5 guests