Drawing Picture On The Highlighted Option

Hello everybody,

Sorry for endlessly asking questions, but I'm still a beginner in scripting and I don't know many things.

What I want is to draw a picture near the selection rectangle (on a highlighted item).

Since selection rectangle can be only... well a rectangle, I would like to draw 'something' (a picture) on a highlighted option...

Well it all sound weird ~ this picture should more or less explain what i'm trying to achieve:

Spoiler
aU3Fxac.png
To clarify - I know how to draw a picture, so let's assume it's just like drawing a text or icon on that option.

The question is:

How to draw 'something' on highlighted option?

/ Draw a picture when cursor is on certain index?

I know many of you thinks: Why do you want to do this, why do you need to have everything complicated?

So, if this process will be kinda complex, I'll do something else then.

Just asking, maybe even for future purposes.
Hey ♫

Assuming you are modifying a subclass of Window_Selectable, try:

Code:
def draw_item(index)  if(@index == index)     //Do your stuff for the selected record  end  //Do your drawing for all the itemsend
I'm editing: class Window_MenuStatus < Window_Selectable 

Did you mean something like this?

Spoiler
def draw_item(index) if(@index == index) draw_image(400, 210, "Graphics/Pictures/Status_TP_Twilight_Sparkle.png") end # if if index < 2 actor = $game_party.members[index] enabled = $game_party.battle_members.include?(actor) rect = item_rect(index) draw_item_background(index) draw_actor_face(actor, rect.x + 1, rect.y + 1, enabled) draw_actor_simple_status(actor, rect.x + 108, rect.y + line_height / 2) else # reserve actor = $game_party.members[index] enabled = $game_party.battle_members.include?(actor) rect = item_rect(index) draw_item_background(index) #draw_actor_face(actor, rect.x + 1, rect.y + 1, enabled) draw_actor_minimized_status(actor, rect.x + 108, rect.y + line_height / 2) end # if end # def
(That's actually my draw_item method, how to setup that properly?)

WtvmtpT.png


I'm really sorry, I think I confused you. What I meant is to draw something on highlighted option, just something like attaching that picture to selecting rectangle upon highlighting a party member with index > 1.
@index is the currently selected index, therefore if @index==index then we are working on the highlighted option. In your code which draws your image is only drawn once, when dealing with the highlighted option but because you always draw it in the same place it doesn't look like it. Try something like:

if(@index == index) r = item_rect(index) ox = -30 oy = item_height/2 draw_image(r.x+ox, r.y+oy, "Graphics/Pictures/Status_TP_Twilight_Sparkle.png")end # ifYou will have to fiddle with oy and ox to get the positioning right, but this will draw that image relative to the highlighted option.
Yes that works, kinda.

It draws pictures at correct places, but It's not drawing a picture near the 'selection rectangle' but it draws them after selecting a character and moving it.

So... when I'll choose third character and replace with first one - the picture will stay in the third slot,

now when I'll replace fourth character with the first one, it again will draw a picture in 4th slot etc.

That way all the pictures are displayed at the same time and it's not dependent on cursor position.

The pictures are disposed after selecting that slot again.

I'm kinda confused, it's hard to explain. =P
Ah, I see

Try 

@pending_index instead of @index?, which is "Pending position (for formation)"
Something like this?

def draw_item(index) if(@pending_index == index) r = item_rect(index) ox = 400 #-30 oy = item_height/2 draw_image(r.x+ox, r.y+oy, "Graphics/Pictures/Status_TP_Twilight_Sparkle.png") end # if if index < 2 ~~~~~~full-size window else # reserve ~~~~~~small window end # if end # defThat didn't draw a picture at all. Did I do something wrong? =P

Actually after changing (ox) it draws these pictures, but the same thing happens - it draws upon selecting ~ not highlighting.

Hmm... It will be harder than I thought.
Hmm, can you PM me a project with the script and files? If I can fiddle around with it I should probably be able to get it to work 🙂  
OK I'll prepare all necessary files, and remove everything not needed to shrink file-size. =P

~ Thank you for taking your time. =P

Original thread: https://forums.rpgmakerweb.com/threads/drawing-picture-on-the-highlighted-option.43238/