The RPG Maker Resource Kit

RMRK RPG Maker Creation => RPG Maker General => General Scripting => Topic started by: heisenman on November 11, 2010, 04:10:36 AM

Title: YEM Item Overhaul opacity.
Post by: heisenman on November 11, 2010, 04:10:36 AM
Hello people I'd like to request your help for something hopefully simple; I've modified mutilated YEM Item Overhaul script but I can't seem to set the opacity of the command and help window.
I've also tried to change values in Window_Item and Scene_Item, but it didn't work.

Here's my abomination http://pastebin.com/gt4kec25.

Also, I havent encountered any error so far using it, but if you find one please post.
Thanks in advance.
Title: Re: YEM Item Overhaul opacity.
Post by: heisenman on November 12, 2010, 03:50:00 PM
Bump.
Title: Re: YEM Item Overhaul opacity.
Post by: modern algebra on November 12, 2010, 08:06:32 PM
Yeah, there shouldn't be any problem with setting the opacity in Scene_Item.

At line 1190, you could put:

@help_window.opacity = x

At line 1245, you could put:


@command_window.opacity = x


The only reason I can see that that wouldn't work is if the Help and Command window classes themselves modify opacity somewhere else, like in update. Anyway, if it isn't working, take a peek into those classes and see what they're up to
Title: Re: YEM Item Overhaul opacity.
Post by: heisenman on November 13, 2010, 03:37:00 AM
It worked!

Now, I wanted to modify the opacity because I intended to use a picture as background, so I put
    @target_window.opacity = 255
    @itemback= Sprite.new(@viewport)
    @itemback.bitmap = Cache.system("Gameover")
    @itemback.x = 0
    @itemback.y = 0
    @itemback.z = 0

In line 1198 or so (most certainly this isn't the correct method).
EDIT: The problem now is that I can't see the background picture below the target window.

(https://rmrk.net/proxy.php?request=http%3A%2F%2Fimg255.imageshack.us%2Fimg255%2F4443%2F48392468.png&hash=22bd4503b55359ea89c3520fa75dba0713c4cc9f)





Oh, I forgot to say, that for some reason YEM Item Overhaul now only works in conjunction with Centered Command Window.
[spoiler]class Window_Command_Centered < Window_Command
 
  #--------------------------------------------------------------------------
  # new method: draw_item
  #--------------------------------------------------------------------------
  def draw_item(index, enabled = true)
    rect = item_rect(index)
    rect.x += 4
    rect.width -= 8
    self.contents.clear_rect(rect)
    self.contents.font.color = normal_color
    self.contents.font.color.alpha = enabled ? 255 : 128
    self.contents.draw_text(rect, @commands[index],1)
  end
 
end # Window_Command_Centered
[/spoiler]
It's in the new Melody demo, along with some unfinished scripts. It's still named "1.00m", but it's different from the old 1.00m version.
Title: Re: YEM Item Overhaul opacity.
Post by: modern algebra on November 13, 2010, 01:00:50 PM
Set the target window opacity to less than 255 then in the first line you quoted there. Just put it to 0 or something.
Title: Re: YEM Item Overhaul opacity.
Post by: heisenman on November 13, 2010, 01:08:05 PM
I set it to 255 because I actually want it to show, but I fear that's not the problem. The background is still not visible.

(https://rmrk.net/proxy.php?request=http%3A%2F%2Fimg686.imageshack.us%2Fimg686%2F8517%2F61389406.png&hash=1956832399f9931d44227127eda8bb7e2f769e02)



EDIT: I've solved the problem.
Thanks for your help modern algebra.