GREATREDSPIRIT'S PROFILE

sherman






o
Mario vs. The Moon Base
Mario must fight his way to Bowser's Moon Base to rescue the Princess!

Search

Filter

[Simple] How to display numbers with script~

Here's a quick demo. I don't know what you want the number to do exactly so its a pretty awful demo.

Download link. Requires RMVX RTP.

If you need it to do more or something else, ask and I'll see what I can do.

Five Random Thoughts About Video Games.

Either way the game is pretty dark and depressing and not your regular Nintendo fare. Its not just the dark content either, what about the Magpyies?


Also the dance is far cooler than any party.

12/12/2012 aka The Mayan Prophecy

If the Mayans could calculate the end of the world then I'm sure they'd be able to come up with a Gregorian Calender and make sure the predicted end of the world lands on a convienent date!

VX scripter needed, I offer art and sprites in exchange

Is this just a largely frontend change to the VX battle system then? And is that black border supposed to be there?

12/12/2012 aka The Mayan Prophecy

Using the power of HARD MATH I calculated that the world ended two years ago. People just haven't realized it yet.

Its all trash.

Five Random Thoughts About Video Games.

author=Neophyte link=topic=1683.msg39441#msg39441 date=1224793517
They could have done something with Mother 3.

I'd be interested to see what its ESRB rating would've been or the public response (if any) to "Good news and bad news" or the mailboxes&co.

[Simple] How to display numbers with script~

Copy this into the script editor... somewhere. It shouldn't matter where.


class Sprite

# Define the colours to use if the number is positive, negative, or zero
POSITIVE_COLOR = Color.new( 64, 255, 64, 255)
NEGATIVE_COLOR = Color.new(255, 64, 64, 255)
ZERO_COLOR = POSITIVE_COLOR

# Define the default Z value of any sprite this method generates
DEFAULT_Z = 10

# Create a sprite object that displays a number with a colour based on its
# sign at the intended x/y and return it to the caller
def Sprite.ShowNumber(number, x, y, z = DEFAULT_Z)

# Get the size of the numbers so the appropriate bitmap can be created
textSize = Bitmap.new(32, 32).text_size(number)

# Prepare the sprite object to return
returnSprite = Sprite.new
returnSprite.bitmap = Bitmap.new(textSize.width, textSize.height)
# Set the X/Y/Z of the sprite to the given values
returnSprite.x = x
returnSprite.y = y
returnSprite.z = z

# Remember the default font color of the sprite's bitmap
oldColor = returnSprite.bitmap.font.color.dup
# Set the font color based on the sign of the number
# If the number is positive
if number > 0
# Set the font color to its positive color
returnSprite.bitmap.font.color = POSITIVE_COLOR
# If the number is at zero (has no sign)
elsif number == 0
# Set the font color to its no sign color
returnSprite.bitmap.font.color = ZERO_COLOR
# Otherwise the number has to be negative
else
# So set the font color to its negative color
returnSprite.bitmap.font.color = NEGATIVE_COLOR
end

# Draw the number onto the sprite bitmap
returnSprite.bitmap.draw_text(0, 0, textSize.width, textSize.height, number)
# Reset the sprite bitmap's font
returnSprite.bitmap.font.color = oldColor

# Return the prepared sprite
return returnSprite
end

end


To use it use the Script function in an event. Call the method and it'll give you a reference to your newly created sprite. The arguments are:
1) The number to show
2) The X coordinate of the upper-left corner
3) The Y coordinate of the upper-left corner
4) The Z coordinate (defaults to 10 which is above the map)

Example:

@sprite = Sprite.ShowNumber(9000, 320, 240)
*event stuff here*
@sprite.x = 100
*more event stuff here*
@sprite.dispose

This'll show the number 9000 in green with the upper left corner at 320x240. After some event stuff the number will move so its x coordinate is at 100. Later on the sprite is removed when @sprite.dispose is called.

If you don't want the negative sign in front of negative numbers (I wasn't sure if you wanted that or not) find this line:

returnSprite.bitmap.draw_text(0, 0, textSize.width, textSize.height, number)

And replace it with:

returnSprite.bitmap.draw_text(0, 0, textSize.width, textSize.height, number.abs)


If you've having trouble with it I can make a simple demo of it.

(Also why is text_size an instance method instead of a class method? I shouldn't have to allocate a bitmap just to use that dang method!
)

Official Review Thread:DRAGOON LEGENDS REVIEWED

author=Max McGee link=topic=2194.msg39205#msg39205 date=1224617829
Saggitarious sucks

If you remove his gear he'll manage to get a turn once in a while!


Yeah the gameplay is awful. I hope the new demo fixes the rediculous difficulty because the next dungeon after the flashback is far worse.

Mother 3/Persona 2: IS Fan Translations Complete

When an enemy falls asleep the main music quiets down and the beat gets a lot louder. Abuse Duseter's pendulum in test battles to get practice music tracks. Thankfully its never mandatory, I never got higher than a 12 hit combo out of sheer luck and I never got them on any boss where it could've been handy.

Mother 3/Persona 2: IS Fan Translations Complete

Just beat Mother 3




:(