'Advanced' Bitmap && Color methods

??????

Diabolical Codemaster
Veteran
Joined
May 11, 2012
Messages
6,513
Reaction score
3,203
First Language
Binary
Primarily Uses
RMMZ
Quick question :

Would you guys say that I would be best to clone or dup the object for non destructive methods in both Bitmap and Color class'  ?
 
Last edited by a moderator:

Solistra

Veteran
Veteran
Joined
Aug 15, 2012
Messages
593
Reaction score
247
Primarily Uses
A bit out of topic. But it seems you still could call Kernel exit by calling

Kernel.exit
If you read the instructions for the REPL I wrote with Enelvon, you'd know that I explicitly mention having to either call Kernel.exit or raise a SystemExit exception manually when inside the context of an object with an alternative exit method defined. ;)


So yes, that's exactly what you have to do. And it's still obnoxious.


Also, Dekita, I generally opt for dup when performing non-destructive operations. You could technically use either, and clone is more complete (it copies frozen status and singleton methods / constants), but dup does everything you'd reasonably need to operate on a shallow copy.
 
Last edited by a moderator:

??????

Diabolical Codemaster
Veteran
Joined
May 11, 2012
Messages
6,513
Reaction score
3,203
First Language
Binary
Primarily Uses
RMMZ
I will stick with clone then. - Just in the event the singleton methods are required by potential users :)

Also - does this seem legit or have I missed something (again...)

#===============================================================================class Bitmap#===============================================================================  #-----------------------------------------------------------------------------  # Modified clone method to return self.  #-----------------------------------------------------------------------------  def clone    super    self  endendNone of my non destructive effects happen properly if I dont have this in place but i have the feeling I have overlooked something important again :/

Kind of get the feeling that returning self is undoing the clone...

Edit:

Same with dup..
 
Last edited by a moderator:

Solistra

Veteran
Veteran
Joined
Aug 15, 2012
Messages
593
Reaction score
247
Primarily Uses
string = 'hello'
class << string


def clone


super


self


end


end


string.clone.upcase! # => 'HELLO'


string # => 'HELLO'

I hope that makes it clear what the problem is.
 
  • Like
Reactions: PK8

??????

Diabolical Codemaster
Veteran
Joined
May 11, 2012
Messages
6,513
Reaction score
3,203
First Language
Binary
Primarily Uses
RMMZ
Its not cloning it at all... Its changing the original.

Hmm...
 

Ultim

Kartoffel.
Veteran
Joined
May 21, 2014
Messages
787
Reaction score
117
First Language
Arabic
Primarily Uses
At least it looks better than the unreadeable version at the status update.
 

Napoleon

Veteran
Veteran
Joined
Dec 29, 2012
Messages
869
Reaction score
97
First Language
Dutch
Primarily Uses
Great script. Another thing that should have been build-in into RPG Maker Ace by default imo.

Basically, I am wondering if other script writers would actually use a script that offers such features?
Personally I try to avoid having to require other scripters scripts. Mostly because they don't allow me to share their scripts along with mine even though their scripts are totally free. So this would (for me) depend on the license.

It seems to be executed by the cpu instead of the gpu. So some of these methods should be called with caution (so not every frame) I suppose.
 

??????

Diabolical Codemaster
Veteran
Joined
May 11, 2012
Messages
6,513
Reaction score
3,203
First Language
Binary
Primarily Uses
RMMZ
Oh yea. Most of these methods should be called one time only (for each time you wish to change the bitmap).

Also - the usage rights on the scripts are pretty much non existent. I have only requested that the header remains intact so people can see who has contributed to the script's methods :)

Just trying to catch up a little bit on workload and then this will be updated again and released for all to use/disregard :D
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,862
Messages
1,017,049
Members
137,569
Latest member
Shtelsky
Top