Original Source
- Original title: Drawing multiple text bitmap on screen [VXAce]
- Original author: Sapphidoll
- Original date: April 3, 2022
- Source thread: https://forums.rpgmakerweb.com/threads/drawing-multiple-text-bitmap-on-screen-vxace.146396/
- Source forum path: Game Development Engines > Ruby Game System (RGSS) Scripts > RGSSx Script Support
Summary
Sorry for the new account, can't remember my old one nor the email from decade ago. My intended script is to check every events in the map for those with the correct "graphic"'s filename and get enemy's parameter from the database based on those names then draw the parameter as a bitmap text on top of the event, at least that's what I think I am doing. Spoiler: ss View attachment 221903
Archived First Post
My intended script is to check every events in the map for those with the correct "graphic"'s filename and get enemy's parameter from the database based on those names then draw the parameter as a bitmap text on top of the event, at least that's what I think I am doing.
the top image is the one I want, but for some reason it only stays like that for a split second then only the event with highest ID number keep its number.
# ============================================================================
Fname = "Verdana"
Fsize = 13
Fshadow = 20
Fbold = true
# ============================================================================
end
class Game_Map
alias Sapphidoll_EnemyHPShow_update update
def update(main = false)
update_HPpop if @popHP
Sapphidoll_EnemyHPShow_update(main)
end
def update_HPpop
@popHP.update
end
def dispose_HPpop
@popHP.dispose if @popsprite
@popHP = nil
end
def monsterIDcheck(i)
if $game_map.events.character_name == "$slime"
return(1)
end
if $game_map.events.character_name == "$bee"
return(2)
else
return(0)
end
end
def enemyHPdisplay
i = 1
while i <= $game_map.events.size
monID = i
monData = monsterIDcheck(i)
if monData != 0
@popHP = Sprite_enemyHPdisplay.new(@viewport1, monID, monData)
end
i+= 1
end
end
end
class Sprite_enemyHPdisplay < Sprite
def initialize(viewport,monID, monData)
super(viewport)
@displayx = $game_map.events[monID].screen_x
@displayy = $game_map.events[monID].screen_y
@displayed_HP = $data_enemies[monData].params[0]
create_bitmap
update
end
def create_bitmap
self.bitmap = Bitmap.new(200, 20)
self.bitmap.rect.x = @displayx
self.bitmap.rect.y = @displayy
self.x = @displayx - 99
self.y = @displayy -18
self.z = 3
self.bitmap.font.size = Sapphidoll_HPdisplay::Fsize
self.bitmap.font.name = Sapphidoll_HPdisplay::Fname
self.bitmap.font.shadow = Sapphidoll_HPdisplay::Fshadow
self.bitmap.font.bold = Sapphidoll_HPdisplay::Fbold
end
def update
super
bitmap.draw_text(self.bitmap.rect, @displayed_HP, 1)
end
end
class Scene_Map < Scene_Base
def dispose_spriteset
@spriteset.dispose
$game_map.dispose_HPpop
end
end
class Game_Interpreter #no error
def showmonsterHP()
$game_map.enemyHPdisplay()
end
end
the code is based on Galv's Event Pop-Ups. can anyone tell me what's exactly wrong with it? I am not much of programmer. I also use another script to fix the camera position so I don't need the text to move around.
Downloads / Referenced Files
Log in, then follow the RPG Maker Developers Group to see these download links.
Log in to downloadCreator Claims / Removal
If you are the original creator and want this listing reassigned, edited, or removed, join BMMPlay and contact the moderators with proof that matches the original RPG Maker Web profile, linked GitHub, itch.io page, or another public creator identity.
Replies (0)
No replies yet.
Topic Summary
Loading summary...