Bitmap manipulation

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,108
Reaction score
13,713
First Language
English
Primarily Uses
RMMV
I think I'm going to have a few questions, so will just add as I go ...

If I have a Sprite_Character that has a bitmap, and I put this in one of the functions:

this.oldBitmap = this.bitmap
am I correct in saying that I now have two variables that point to the same bitmap object?  Or does it clone it, so I can do stuff to one without affecting the other?
 

estriole

Veteran
Veteran
Joined
Jun 27, 2012
Messages
1,316
Reaction score
537
First Language
indonesian
it will become two variable that point to same bitmap.

edit:

even this:

var a = [1,3,4];var b = a;b[0] = 10;console.log(a); // [10,3,4]so it's not cloned.

if array / some object we can use JsonEx.makeDeepCopy(objectyouwanttocopyhere)

but i think bitmap cannot be processed that way.
 
Last edited by a moderator:

Quxios

Veteran
Veteran
Joined
Jan 8, 2014
Messages
1,055
Reaction score
785
First Language
English
Primarily Uses
RMMV
Estriole pretty much covered it. But if you want to clone the bitmap, I think would have to create a new Bitmap equal to the old Bitmaps width / height then just do a block transfer from the old to the new.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,108
Reaction score
13,713
First Language
English
Primarily Uses
RMMV
Thought so.  Thanks.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.
Can someone recommend some fun story-heavy RPGs to me? Coming up with good gameplay is a nightmare! I was thinking of making some gameplay platforming-based, but that doesn't work well in RPG form*. I also was thinking of removing battles, but that would be too much like OneShot. I don't even know how to make good puzzles!
one bad plugin combo later and one of my followers is moonwalking off the screen on his own... I didn't even more yet on the new map lol.
time for a new avatar :)

Forum statistics

Threads
106,017
Messages
1,018,356
Members
137,802
Latest member
rencarbali
Top