Сериал про странные подходы эльфа к скриптам мейкера продолжается.
На сей раз я не смог отобразить нужную мне картинку, хотя использовал только стандартные средства. Пусть и немного нестандартным способом.
Вот код:
class Game_Screen
attr_accessor :pictures
end
class Sprite_Picture < Sprite
def picture
@picture
end
end
class Scene_Map
def main
_preload_other_things
_preload_spriteset
_preload_message_window
_fade_in
_main_loop
_prepare_to_change_scene
end
def _preload_spriteset
@spriteset = Spriteset_Map.new
end
def _preload_message_window
@message_window = Window_Message.new
end
def _preload_other_things
#
end
def _fade_in
Graphics.transition
end
def _main_loop
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
end
def _prepare_to_change_scene
Graphics.freeze
__dispose_all_the_things
if $scene.is_a?(Scene_Title)
__prepare_to_fade
end
end
def __dispose_all_the_things
@spriteset.dispose
@message_window.dispose
end
def __prepare_to_fade
Graphics.transition
Graphics.freeze
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
_update_map
_update_spriteset
_update_message
_update_other_things
_goto_game_over
_goto_title
_show_transition
_show_message_window
_battle_from_encounter_call
_menu_call
_debug_call
_player_try_calling
end
def _update_map
loop do
# Update map, interpreter, and player order
# (this update order is important for when conditions are fulfilled
# to run any event, and the player isn't provided the opportunity to
# move in an instant)
$game_map.update
$game_system.map_interpreter.update
$game_player.update
# Update system (timer), screen
$game_system.update
$game_screen.update
# Abort loop if player isn't place moving
unless $game_temp.player_transferring
break
end
# Run place move
transfer_player
# Abort loop if transition processing
if $game_temp.transition_processing
break
end
end
end
def _update_spriteset
@spriteset.update
end
def _update_message
@message_window.update
end
def _update_other_things
#
end
def _goto_game_over
if $game_temp.gameover
$scene = Scene_Gameover.new
return
end
end
def _goto_title
if $game_temp.to_title
$scene = Scene_Title.new
return
end
end
def _show_transition
if $game_temp.transition_processing
$game_temp.transition_processing = false
if $game_temp.transition_name == ""
Graphics.transition(20)
else
Graphics.transition(40, "Graphics/Transitions/" +
$game_temp.transition_name)
end
end
end
def _show_message_window
if $game_temp.message_window_showing
return
end
end
def _battle_from_encounter_call
if $game_player.encounter_count == 0 and $game_map.encounter_list != []
unless $game_system.map_interpreter.running? or
$game_system.encounter_disabled
n = rand($game_map.encounter_list.size)
troop_id = $game_map.encounter_list[n]
if $data_troops[troop_id] != nil
$game_temp.battle_calling = true
$game_temp.battle_troop_id = troop_id
$game_temp.battle_can_escape = true
$game_temp.battle_can_lose = false
$game_temp.battle_proc = nil
end
end
end
end
def _menu_call
if Input.trigger?(Input::B)
unless $game_system.map_interpreter.running? or
$game_system.menu_disabled
$game_temp.menu_calling = true
$game_temp.menu_beep = true
end
end
end
def _debug_call
if $DEBUG and Input.press?(Input::F9)
$game_temp.debug_calling = true
end
end
def _player_try_calling
unless $game_player.moving?
if $game_temp.battle_calling
call_battle
elsif $game_temp.shop_calling
call_shop
elsif $game_temp.name_calling
call_name
elsif $game_temp.menu_calling
call_menu
elsif $game_temp.save_calling
call_save
elsif $game_temp.debug_calling
call_debug
end
end
end
#--------------------------------------------------------------------------
# * Battle Call
#--------------------------------------------------------------------------
def call_battle
# Clear battle calling flag
$game_temp.battle_calling = false
# Clear menu calling flag
$game_temp.menu_calling = false
$game_temp.menu_beep = false
# Make encounter count
$game_player.make_encounter_count
# Memorize map BGM and stop BGM
$game_temp.map_bgm = $game_system.playing_bgm
$game_system.bgm_stop
# Play battle start SE
$game_system.se_play($data_system.battle_start_se)
# Play battle BGM
$game_system.bgm_play($game_system.battle_bgm)
# Straighten player position
$game_player.straighten
# Switch to battle screen
$scene = Scene_Battle.new
end
#--------------------------------------------------------------------------
# * Shop Call
#--------------------------------------------------------------------------
def call_shop
# Clear shop call flag
$game_temp.shop_calling = false
# Straighten player position
$game_player.straighten
# Switch to shop screen
$scene = Scene_Shop.new
end
#--------------------------------------------------------------------------
# * Name Input Call
#--------------------------------------------------------------------------
def call_name
# Clear name input call flag
$game_temp.name_calling = false
# Straighten player position
$game_player.straighten
# Switch to name input screen
$scene = Scene_Name.new
end
#--------------------------------------------------------------------------
# * Menu Call
#--------------------------------------------------------------------------
def call_menu
# Clear menu call flag
$game_temp.menu_calling = false
# If menu beep flag is set
if $game_temp.menu_beep
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Clear menu beep flag
$game_temp.menu_beep = false
end
# Straighten player position
$game_player.straighten
# Switch to menu screen
$scene = Scene_Menu.new
end
#--------------------------------------------------------------------------
# * Save Call
#--------------------------------------------------------------------------
def call_save
# Straighten player position
$game_player.straighten
# Switch to save screen
$scene = Scene_Save.new
end
#--------------------------------------------------------------------------
# * Debug Call
#--------------------------------------------------------------------------
def call_debug
# Clear debug call flag
$game_temp.debug_calling = false
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Straighten player position
$game_player.straighten
# Switch to debug screen
$scene = Scene_Debug.new
end
#--------------------------------------------------------------------------
# * Player Place Move
#--------------------------------------------------------------------------
def transfer_player
# Clear player place move call flag
$game_temp.player_transferring = false
# If move destination is different than current map
if $game_map.map_id != $game_temp.player_new_map_id
# Set up a new map
$game_map.setup($game_temp.player_new_map_id)
end
# Set up player position
$game_player.moveto($game_temp.player_new_x, $game_temp.player_new_y)
# Set player direction
case $game_temp.player_new_direction
when 2 # down
$game_player.turn_down
when 4 # left
$game_player.turn_left
when 6 # right
$game_player.turn_right
when 8 # up
$game_player.turn_up
end
# Straighten player position
$game_player.straighten
# Update map (run parallel process event)
$game_map.update
# Remake sprite set
@spriteset.dispose
@spriteset = Spriteset_Map.new
# If processing transition
if $game_temp.transition_processing
# Clear transition processing flag
$game_temp.transition_processing = false
# Execute transition
Graphics.transition(20)
end
# Run automatic change for BGM and BGS set on the map
$game_map.autoplay
# Frame reset
Graphics.frame_reset
# Update input information
Input.update
end
end
class Scene_Map
def _preload_other_things
#__recover_player
#__free_from_design_hints
__preload_hud
end
def __preload_hud
___hud_back
#___hud_grad
#___hud_fore
end
def ___hud_back
$game_screen.pictures.push(Sprite_Picture.new(@viewport2,Game_Picture.new(48)))
name, origin, x, y = "hp_niz", 0, 0, 0
zoom_x, zoom_y, opacity, blend_type = 1.0, 1.0, 128, 0
$game_screen.pictures.last.picture.show(name, origin, x, y, zoom_x, zoom_y, opacity, blend_type)
end
end
Вроде всё нужное скопировал. Картинку сами вставьте, какую хотите.
В чем может быть косяк?