Skip to content

Instantly share code, notes, and snippets.

@LMichelle
Created Mar 10, 2018
Embed
What would you like to do?
Language of Lyse - Custom Window
#==============================================================================
# ** Window_People
#------------------------------------------------------------------------------
# Waar de actors hun naam, picture, lv enz. in staan.
#==============================================================================
class Window_People < Window_Selectable
def initialize
super(0,0,320,480)
self.contents = Bitmap.new(width - 20, height - 20)
@column_max = 2
refresh
self.active = false
self.index = -1
end
################ def refresh
def refresh
self.contents.clear
@item_max = $game_party.actors.size
@bitmap = Bitmap.new(width - 20, height - 20)
for i in 0 ... $game_party.actors.size
x = (i * 160) + 5
y = 15
if i >= 2
x -= 320
y = 245
end
actor = $game_party.actors[i]
self.contents.draw_text(x + 32, y + 96, 50, 20, actor.name)
draw_menu_head(actor, x + 10, y)
# draw HP bar and text
self.contents.draw_text(x, y +116, 20, 20, "HP")
draw_hp_bar(actor, x + 40, y + 121, 58)
#self.contents.draw_text(x + 4 , y + 120, 48, 20, actor.hp.to_s, 2)
# self.contents.draw_text(x + 40, y + 120, 48, 20, "/", 1)
#self.contents.draw_text(x + 50, y + 120, 48, 20, actor.maxhp.to_s, 2)
# draw SP bar and text
self.contents.draw_text(x, y + 140, 20, 20, "SP")
draw_sp_bar(actor, x + 40, y + 145, 58)
# draw state, level, exp
for j in 0 ... actor.states.size
#$indexstates = actor.states.size
draw_state(actor, x + 100 , (y + 96) + (j * 24), actor.states[j])
end
draw_actor_level(actor, x, y + 155)
self.contents.draw_text(x, y +180, 40, 20, "EXP")
if actor.level == 99 then
self.contents.draw_text(x + 40, y + 180, 60, 20, "____ / ____")
else
draw_exp_bar(actor, x + 40, y + 185)
end
end # end for met actors
end # end def
############ def draw menu Head
def draw_menu_head(actor, x, y)
if actor.name == "Nica" then
bitmap = RPG::Cache.picture("MenuNica.png")
elsif actor.name == "Thye"
bitmap = RPG::Cache.picture("MenuThye.png")
elsif actor.name == "Sehlia"
bitmap = RPG::Cache.picture("MenuSehlia.png")
else
bitmap = RPG::Cache.picture("MenuNayll.png")
end
src_rect = Rect.new(0, 0, 96, 96)
#self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect)
self.contents.blt(x, y, bitmap, src_rect)
end
############ def draw Rect
def draw_rect(x, y)
@rect = Rect.new(x, y, 24, 24)
color = Color.new(255,255,255,255)
self.contents.fill_rect(@rect, color)
end
############## def draw state
def draw_state(battler, x, y, state_id)
#for i in battler.states $data_states[i].name ==
if $data_states[state_id].name == "Knockout" then
bitmapicon = Bitmap.new("Graphics/Icons/100-State01.png")
elsif $data_states[state_id].name == "Venom" then
bitmapicon = Bitmap.new("Graphics/Icons/100-State02.png")
elsif $data_states[state_id].name == "Stun" then
bitmapicon = Bitmap.new("Graphics/Icons/100-State03.png")
elsif $data_states[state_id].name == "Sleep" then
bitmapicon = Bitmap.new("Graphics/Icons/100-State04.png")
else
bitmapicon = Bitmap.new("Graphics/Icons/001-Weapon01.png")
end
src_recticon = Rect.new(0, 0, 24, 24)
self.contents.blt(x, y, bitmapicon, src_recticon)
# end
end
################## def cursor update
def update_cursor_rect
if @index < 0
self.cursor_rect.empty
else
#self.cursor_rect.set(0, @index * 116, self.width - 32, 96)
x = @index * 160
y = 10
if @index >= 2
x -= 320
y = 240
end
self.cursor_rect.set(x, y, 128 , 208)
end
end
#######
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment