Squall's Slicky Scripts
#1
Squall's Slicky Scripts
by Selwyn
* When he was Squall



INTRODUCTION
Selwyn @ RMXP.Org Wed Apr 05, 2006 Wrote:NOTE : this is for scripters mainly.

this brings a few modifications to basic classes such as #Sprite #Array #Color and #String

here's the code



SCRIPT
The Script



HOW TO USE
#Array
:count_min returns [smallest value, index of the value]
[2, 3, 7, 5, 1, 6] # returns [1, 4]

:count_min!
same as count_min but delete the smallest value

:count_max returns [biggest value, index of the value]
[2, 3, 7, 5, 1, 6] # returns [7, 2]

:count_max!
same as count_max but delete the biggest value

#Sprite
:new(viewport, bitmap)
allows to set the bitmap while initializing the sprite

:true_x(=)
true_x is nil by default. when setting a value for it, the sprite will move smoothly to the

value

:true_y(=)
same as true_x but for y coord.

#String
:wrap(width)
wrap the text according to width's value. return an array containing the different lines.

#Color
Color.hex_to_ary(string)
return an array of decimal numbers.
Color.hex_to_ary("FF6400") # returns [255, 100, 0]

:new(string, opacity)
allows to use HTML hex colors instead of decimal numbers
Color.new("FFFFFF") = Color.new(255, 255, 255)

:negative!
set the color to it's negative.
color = Color.new(0, 0, 0)
color.negative!
color = Color.new(255, 255, 255)

enjoy!

EDIT : added Color negative method



TERMS AND CONDITIONS
As always, Give Credit and Enjoy!
Reply }


Possibly Related Threads…
Thread Author Replies Views Last Post
   Scripts; Updated; Scripts Demo Added Geowil 8 13,416 03-04-2010, 10:50 AM
Last Post: PK8



Users browsing this thread: 1 Guest(s)