RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
[Solved] Show picture instead of using windowskin

0 Members and 1 Guest are viewing this topic.

**
Rep:
Level 74
Fallen Angel
Not too sure where to post this (Couldn't find a script support area and it's not really a request), so mods feel free to move this if it's in the wrong area.

Basically, I'm using XRXS' Help Plus script. It repositions and adds details to the default VX help text (Description window) like so:

Spoiler for:

It's the window with the three lines at the bottom of the screenie. However, as you can see, the equipment list to the right of the screenie overlaps the help window. What I'm hoping for is to be able to edit it to use a picture as a background for the help window rather than using the windowskin. The name of the picture file should be definable in the header of the script. The width of the picture would be 544/Graphics.width (Depending on whether or not resolution changers are used) and the height should be... well, whatever it is you want. >_>

This is the script I'm using:

Spoiler for:
Code: [Select]
# ??? XRXSv17-HP1. Help ? Plus ???
#
# publish 2010/ 5/ 4
# update     - 12/23
#
#==============================================================================
# ???????
#==============================================================================
module XRXSV17_RPGBaseItemBase
  def mnd
    return 0
  end
end
#module RPG::BaseItem
class RPG::BaseItem
  include XRXSV17_RPGBaseItemBase
end
#==============================================================================
# ???????????
#==============================================================================
module XRXSV_FitWindow
  def initialize
    @contents_sprite = Sprite_Base.new
    @contents_sprite.bitmap = Bitmap.new(1,1)
    super
    self.contents_opacity = 0
  end
  def create_contents
    self.width  += 32
    self.height += 32
    super
    self.width  -= 32
    self.height -= 32
  end
  def contents
    return @contents_sprite.bitmap
  end
  def contents=(bitmap)
    @contents_sprite.bitmap = bitmap
  end
  def x=(n)
    @contents_sprite.x = n
    super
  end
  def y=(n)
    @contents_sprite.y = n
    super
  end
  def z=(n)
    @contents_sprite.z = n + 3
    super
  end
  def dispose
    @contents_sprite.dispose
    super
  end
end
module Vocab
  def self.mnd
    return "???"
  end
end
#==============================================================================
# ?????
#==============================================================================
class Window_HelpEX < Window_Help
  include XRXSV_FitWindow
  #--------------------------------------------------------------------------
  # ? ?????????
  #--------------------------------------------------------------------------
  def initialize
    super
    self.height += 32
    self.z += 5
    create_contents
    @item = nil
  end
  #--------------------------------------------------------------------------
  # ? ??????
  #--------------------------------------------------------------------------
  def set(item)
    if @item != item
      self.contents.clear
      if item
        draw_item_name(item, 12, 8)
        set = []
        case item
        when RPG::Item
         
        when RPG::Skill
          if item.atk_f >= 1 and item.spi_f == 0
            type_s = "Skill"
          elsif item.atk_f == 0 and item.spi_f >= 1
            type_s = "Magic"
          else
            type_s = "Special"
          end
          set.push([type_s, ""])
          if item.base_damage == 0
            power_s = "---"
          elsif item.base_damage.abs == 1
            power_s = (item.atk_f + item.spi_f).to_s + "%"
          else
            power_s = item.base_damage.abs.to_s + "~"
          end
          set.push(["Str.", power_s, 32, 72])
          set.push(["Acc.", item.hit.to_s, 32])
          set.push(["Pen.", ""]) if item.ignore_defense
          if item.note[/\\([0-9]+?)hit/]
            set.push([$1 + "hit", ""])
          end
          for state_id in item.plus_state_set
            if state_id == 1
              name = "Death"
            else
              name = $data_states[state_id].name
            end
            set.push([name, "", 56])
          end
        when RPG::Weapon, RPG::Armor
          if item.note[/\\hp\[([+-]*?[0-9]+?)\]/]
            set.push([Vocab.hp, $1])
          end
          if item.note[/\\mp\[([+-]*?[0-9]+?)\]/]
            set.push([Vocab.mp, $1])
          end
          set.push([Vocab.atk, item.atk]) if item.atk >= 1
          set.push([Vocab.def, item.def]) if item.def >= 1
          set.push([Vocab.spi, item.spi]) if item.spi >= 1
          set.push([Vocab.mnd, item.mnd]) if item.mnd >= 1
          set.push([Vocab.agi, item.agi]) if item.agi >= 1
        end
        x = 24
        y = WLH + 8
        for data in set
          self.contents.font.size  = 16
          self.contents.font.color = system_color
          w = (data[2] ? data[2] : 48)
          self.contents.draw_text(x, y, w, WLH, data[0])
          x += w
          self.contents.font.size  = 20
          self.contents.font.color = normal_color
          if data[1].size >= 1
            w = (data[3] ? data[3] : 40)
            self.contents.draw_text(x, y, w, WLH, data[1])
            x += w
          end
        end
        self.contents.font.color = normal_color
        self.contents.draw_text(24, 8 + WLH*2, 500, WLH, item.description)
      end
      @item = item
      @text  = nil
      @align = nil
      self.x = self.x
      self.y = self.y
    end
  end
  def set_text(text, align = 0)
    if text != @text or align != @align
      @contents_sprite.x = self.x + 16
      @contents_sprite.y = self.y + 32
      @item = nil
    end
    super
  end
end

It's in Japanese, but the coding's all in English (Ruby). If there're some parts you need translated, feel fee to ask and I'll translate it for you.
« Last Edit: January 03, 2011, 10:43:43 AM by kirinelf »

***
Rep:
Level 82
aka DigiDeity
I wasn't able to try it out but it should work.

Code: [Select]
# ??? XRXSv17-HP1. Help ? Plus ???
#
# publish 2010/ 5/ 4
# update     - 12/23
#
#==============================================================================
# ???????
#==============================================================================
HELP_WINDOW_IMAGE_NAME = "help_background" # Should be placed in the system folder
module XRXSV17_RPGBaseItemBase
  def mnd
    return 0
  end
end
#module RPG::BaseItem
class RPG::BaseItem
  include XRXSV17_RPGBaseItemBase
end
#==============================================================================
# ???????????
#==============================================================================
module XRXSV_FitWindow
  def initialize
    @contents_sprite = Sprite_Base.new
    @contents_sprite.bitmap = Bitmap.new(1,1)
    super
    self.contents_opacity = 0
  end
  def create_contents
    self.width  += 32
    self.height += 32
    super
    self.width  -= 32
    self.height -= 32
  end
  def contents
    return @contents_sprite.bitmap
  end
  def contents=(bitmap)
    @contents_sprite.bitmap = bitmap
  end
  def x=(n)
    @contents_sprite.x = n
    super
  end
  def y=(n)
    @contents_sprite.y = n
    super
  end
  def z=(n)
    @contents_sprite.z = n + 3
    super
  end
  def dispose
    @contents_sprite.dispose
    super
  end
end
module Vocab
  def self.mnd
    return "???"
  end
end
#==============================================================================
# ?????
#==============================================================================
class Window_HelpEX < Window_Help
  include XRXSV_FitWindow
  #--------------------------------------------------------------------------
  # ? ?????????
  #--------------------------------------------------------------------------
  def initialize
    super
    self.height += 32
    self.z += 5
    self.opacity = 0
    @background_image = Sprite.new
    @background_image.bitmap = Cache.system(HELP_WINDOW_IMAGE_NAME)
    @background_image.x = self.x
    @background_image.y = self.y
    create_contents
    @item = nil
  end
  #--------------------------------------------------------------------------
  # ? ??????
  #--------------------------------------------------------------------------
  def set(item)
    if @item != item
      self.contents.clear
      if item
        draw_item_name(item, 12, 8)
        set = []
        case item
        when RPG::Item
         
        when RPG::Skill
          if item.atk_f >= 1 and item.spi_f == 0
            type_s = "Skill"
          elsif item.atk_f == 0 and item.spi_f >= 1
            type_s = "Magic"
          else
            type_s = "Special"
          end
          set.push([type_s, ""])
          if item.base_damage == 0
            power_s = "---"
          elsif item.base_damage.abs == 1
            power_s = (item.atk_f + item.spi_f).to_s + "%"
          else
            power_s = item.base_damage.abs.to_s + "~"
          end
          set.push(["Str.", power_s, 32, 72])
          set.push(["Acc.", item.hit.to_s, 32])
          set.push(["Pen.", ""]) if item.ignore_defense
          if item.note[/\\([0-9]+?)hit/]
            set.push([$1 + "hit", ""])
          end
          for state_id in item.plus_state_set
            if state_id == 1
              name = "Death"
            else
              name = $data_states[state_id].name
            end
            set.push([name, "", 56])
          end
        when RPG::Weapon, RPG::Armor
          if item.note[/\\hp\[([+-]*?[0-9]+?)\]/]
            set.push([Vocab.hp, $1])
          end
          if item.note[/\\mp\[([+-]*?[0-9]+?)\]/]
            set.push([Vocab.mp, $1])
          end
          set.push([Vocab.atk, item.atk]) if item.atk >= 1
          set.push([Vocab.def, item.def]) if item.def >= 1
          set.push([Vocab.spi, item.spi]) if item.spi >= 1
          set.push([Vocab.mnd, item.mnd]) if item.mnd >= 1
          set.push([Vocab.agi, item.agi]) if item.agi >= 1
        end
        x = 24
        y = WLH + 8
        for data in set
          self.contents.font.size  = 16
          self.contents.font.color = system_color
          w = (data[2] ? data[2] : 48)
          self.contents.draw_text(x, y, w, WLH, data[0])
          x += w
          self.contents.font.size  = 20
          self.contents.font.color = normal_color
          if data[1].size >= 1
            w = (data[3] ? data[3] : 40)
            self.contents.draw_text(x, y, w, WLH, data[1])
            x += w
          end
        end
        self.contents.font.color = normal_color
        self.contents.draw_text(24, 8 + WLH*2, 500, WLH, item.description)
      end
      @item = item
      @text  = nil
      @align = nil
      self.x = self.x
      self.y = self.y
    end
  end
  def set_text(text, align = 0)
    if text != @text or align != @align
      @contents_sprite.x = self.x + 16
      @contents_sprite.y = self.y + 32
      @item = nil
    end
    super
  end
  alias dispose_background_image dispose unless $@
  def dispose
    dispose_background_image
    @background_image.dispose
  end
end

Deity
Greetings
DigiDeity

├Work┤
├Contact┤


**
Rep:
Level 74
Fallen Angel
Thanks, that works perfectly (Had to change @background_image.y to get it to show where I want). A small modification requested: Could you add an option to modify opacity?

Edit: Oh, got it. I added
Code: [Select]
module XRXSV17N
  OPACITY = 180
end
at the top of the script and
Code: [Select]
@background_image.opacity = XRXVV17N::OPACITY
under @background_image.y. It works. Thanks Deity! Can't rep you with my current post count though. Sorry. >_<
« Last Edit: January 03, 2011, 05:50:06 AM by kirinelf »

***
Rep:
Level 82
aka DigiDeity
Don't worry, I'm glad that I could help you. ;)
And sorry that I couldn't help you with the opacity cause it was late when I went off, about 5a.m. xD

Deity
Greetings
DigiDeity

├Work┤
├Contact┤


**
Rep:
Level 74
Fallen Angel
Don't worry about it. I just looked at the other scripts in the menu and copied what they did there. xD I just hope it's done the right way.