I wasn't sure whether to post this here or in Script requests. Seeing as it's more of a mechanics question than a straight out "please do me a script question" I guess it belongs here.
I am very much a non-scripter and I'm feeling completely lost in what should be something relatively easy.
I have this script for pictoral indicators
And in battle, the characters are indicated like this:
http://www.stkp.com/rpgmxp/xero/battledata_before.jpg[/img]
Which is nice, but I want to jazz it up a bit and add an image in the background behind the character and move around some of the data so it looks like this:
http://www.stkp.com/rpgmxp/xero/battledata_demo.jpg[/img]
I want to do this myself, but I can't figure out how you deal with adding image objects into a script. I read through one window creation tutorial and felt even more lost than when I started.
Is there someone who can tell me what I'm looking for or the basic mechanics of how RGSS deals with images or something (first "a" then "b" etc.)? I'm feeling very frustrated right now because I keep hitting walls when I try to modify windows, images, and so forth to make things work together better in the scripts I'm using.
Thanks in advance
I am very much a non-scripter and I'm feeling completely lost in what should be something relatively easy.
I have this script for pictoral indicators
Code:
=begin
#==============================================================================
# â— Tibuda's Pictoral Indicators
#==============================================================================
=end
#--------------------------------------------------------------------------
# â— Begin SDK Log
#--------------------------------------------------------------------------
SDK.log('Pictoral Indicators', 'Tibuda', 1.0, '3/13/07')
#--------------------------------------------------------------------------
# â— Begin SDK Requirement Check
#--------------------------------------------------------------------------
SDK.check_requirements(2.0, [1])
#--------------------------------------------------------------------------
# â— Begin SDK Enabled Check
#--------------------------------------------------------------------------
if SDK.enabled?('Pictoral Indicators')
class Window_BattleStatus
#--------------------------------------------------------------------------
# * Constants
#--------------------------------------------------------------------------
EMPTY_HP_VIAL = 'vial_empty_red'
EMPTY_SP_VIAL = 'vial_empty_blue'
HP_VIAL = 'vial_red'
SP_VIAL = 'vial_blue'
BG = 'infobg'
#--------------------------------------------------------------------------
# * Draw Vial
#--------------------------------------------------------------------------
def draw_vial(empty, full, percent, x, y)
# Get Empty Bitmap
empty_bitmap = RPG::Cache.picture(empty)
# Create Destination Rect
dest_rect = Rect.new(x, y, empty_bitmap.width, empty_bitmap.height)
# Stretch Blt
self.contents.stretch_blt(dest_rect, empty_bitmap, empty_bitmap.rect)
# Get full Bitmap
full_bitmap = RPG::Cache.picture(full)
# Get Width and Height
width, height = full_bitmap.width, percent * full_bitmap.height / 100
# Get Difference in height
diff = full_bitmap.height - height
# Create Source Rect
src_rect = Rect.new(0, diff, full_bitmap.width, full_bitmap.height)
# Create Destination Rect
dest_rect = Rect.new(x, y + diff, full_bitmap.width, full_bitmap.height)
# Stretch Blt
self.contents.stretch_blt(dest_rect, full_bitmap, src_rect)
end
#--------------------------------------------------------------------------
# * Draw HP
#--------------------------------------------------------------------------
def draw_actor_hp(actor, x, y, width = 144)
# Draw Vial
draw_vial(EMPTY_HP_VIAL, HP_VIAL, 100 * actor.hp / actor.maxhp, x, y)
# Draw Hp Text
self.contents.draw_text(x, y + 40, width, 32, actor.hp.to_s)
end
#--------------------------------------------------------------------------
# * Draw SP
#--------------------------------------------------------------------------
def draw_actor_sp(actor, x, y, width = 144)
# If Actor Maxsp is greater than 0
if actor.maxsp > 0
# Draw Vial
draw_vial(EMPTY_SP_VIAL, SP_VIAL, 100 * actor.sp / actor.maxsp, x, y)
# Draw Sp Text
self.contents.draw_text(x, y + 40, width, 32, actor.sp.to_s)
end
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
# Clear Contents
self.contents.clear
# Run Through Each Actor With index
$game_party.actors.each_with_index do |actor, index|
# Get X coordinate
actor_x = index * 160 + 4
# Draws Name
draw_actor_name(actor, actor_x, -10)
# Draws Hp (index, x placement, y placement)
draw_actor_hp(actor, actor_x, 35)
# Draws Sp
draw_actor_sp(actor, actor_x + 80, 35)
# Draw Attack bar
draw_actor_at(actor, actor_x, 96, 120)
# If Level Up Flags
if @level_up_flags[index]
# Normal Color
self.contents.font.color = normal_color
# Level Up
self.contents.draw_text(actor_x, 120, 120, 32, 'LEVEL UP!')
end
end
end
end
#--------------------------------------------------------------------------
# End SDK Enabled Check
#--------------------------------------------------------------------------
end
And in battle, the characters are indicated like this:
http://www.stkp.com/rpgmxp/xero/battledata_before.jpg[/img]
Which is nice, but I want to jazz it up a bit and add an image in the background behind the character and move around some of the data so it looks like this:
http://www.stkp.com/rpgmxp/xero/battledata_demo.jpg[/img]
I want to do this myself, but I can't figure out how you deal with adding image objects into a script. I read through one window creation tutorial and felt even more lost than when I started.
Is there someone who can tell me what I'm looking for or the basic mechanics of how RGSS deals with images or something (first "a" then "b" etc.)? I'm feeling very frustrated right now because I keep hitting walls when I try to modify windows, images, and so forth to make things work together better in the scripts I'm using.
Thanks in advance