Guten Tag zusammen,
zu beginn muss ich wohl erst einmal klar machen, dass ich mir ein bisschen blöd vorkomme diese Anfrage zu stellen. xD Ich habe tatsächlich lange gesucht, selbst ausprobiert und andere Skripte versucht anzupassen, aber es wollte mir einfach nicht gelingen... Auch hier im Forum scheint es genau die selbe Frage schon einmal gegeben zu haben, allerdings gab es keine Antwort darauf.
Was ich brauch:
Ich brauch ein Skript das nicht mehr macht, als von mir definierte Variablen als Zahl auf dem Bildschirm anzuzeigen.
Wichtig wäre dabei:
-es sollten min. 2 Variablen gleichzeitig angezeigt werden können
-die Anzeige sollte verschwinden und wieder auftauchen, wenn man das Menü öffnet/schließt
-die position der Anzeige sollte einstellbar sein
Ich benötige dieses Skript um eine Munitionsanzeige im HUD zu bauen.
Außerdem benutze ich neben anderen Skripts das "Item Weight Script" von "ForeverZer0", das nebenher auch eine Zahl im HUD anzeigt, eventuell sollte das beachtet werden falls die Anzeigen sich gegenseitig "überschreiben" oder sonstiges. (Ich hab wenig Ahnung vom Skripten, falls das bis hier hin noch nicht klar sein sollte

)
Das Skript besteht aus mehreren Teilen, ich füge hier den HUD display teil mal mit ein, falls dieser beachtet werden muss.
#===============================================================================
# * WeightHUD
#===============================================================================
class WeightHUD < Window_Base
# Set true/false if windowskin should be used or not. If not, text will simply
# be displayed on the screen.
WINDOWED = true
# Set the location of the HUD. [X, Y, WIDTH, HEIGHT]
# I recommend a small X and Y offset if WINDOWED is set to false to have
# the text placed properly and not to far off the edge of the screen.
LOCATION = [0, 0, 144, 64]
# Set the font used for the HUD. [FONT_NAME, FONT_SIZE]
# A value of nil for either setting will have it simply use the default font
FONT = ['Calibri', 20]
# Script Calls:
# hide_weightHUD(true/false) - Sets the hidden state of the weight HUD
#-----------------------------------------------------------------------------
# * initialize
# Creates a new instance of the HUD
#-----------------------------------------------------------------------------
def initialize
super(*LOCATION)
self.windowskin = nil unless WINDOWED
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = FONT[0] == nil ? Font.default_name : FONT[0]
self.contents.font.size = FONT[1] == nil ? Font.default_size : FONT[1]
refresh
end
#-----------------------------------------------------------------------------
# * refresh
# Clears and redraws the HUD
#-----------------------------------------------------------------------------
def refresh
self.contents.clear
self.contents.font.color = system_color
self.contents.draw_text(0, 0, 32, 32, 'WT')
weight, capacity = $game_party.total_weight, $game_party.weight_capacity
color = weight > capacity ? crisis_color : normal_color
self.contents.font.color = color
self.contents.draw_text(32, 0, 42, 32, weight.to_s, 2)
self.contents.font.color = normal_color
self.contents.draw_text(74, 0, 8, 32, '/', 1)
self.contents.draw_text(82, 0, 42, 32, capacity.to_s)
end
end
#===============================================================================
# * Game_Party
#===============================================================================
class Game_Party
#-----------------------------------------------------------------------------
# * refresh_weight
# Tells Scene_Map that the HUD needs refresh when the values change
#-----------------------------------------------------------------------------
alias weight_hud_refresh_weight refresh_weight
def refresh_weight
weight_hud_refresh_weight
if $scene.is_a?(Scene_Map)
$scene.refresh_weightHUD
end
end
end
#===============================================================================
# * Scene_Map
#===============================================================================
class Scene_Map
#-----------------------------------------------------------------------------
# * main
# Creates the HUD and disposes it when the scene ends
#-----------------------------------------------------------------------------
alias item_weight_main main
def main
@weight_hud = WeightHUD.new
item_weight_main
@weight_hud.dispose
end
#-----------------------------------------------------------------------------
# * hide_weightHUD
# Hides/Shows the weight HUD if it is present and not disposed
#-----------------------------------------------------------------------------
def hide_weightHUD(bool)
if @weight_hud != nil && !@weight_hud.disposed?
@weight_hud.visible = bool
end
end
#-----------------------------------------------------------------------------
# * refresh_weightHUD
# Refreshes the weight HUD if it is present and not disposed
#-----------------------------------------------------------------------------
def refresh_weightHUD
if @weight_hud != nil && !@weight_hud.disposed?
@weight_hud.refresh
end
end
end
#===============================================================================
# * Interpreter
#===============================================================================
class Interpreter
#-----------------------------------------------------------------------------
# * hide_weightHUD
# Hides/Shows the weight HUD if it is present and not disposed
#-----------------------------------------------------------------------------
def hide_weightHUD(value = true)
if $scene.is_a?(Scene_Map)
$scene.hide_weightHUD(value)
end
end
end
zum Lesen den Text mit der Maus markieren
Ich bin natürlich glücklich über jede Antwort