(Picture) How do I insert a break so that the image on left turns into the image on the right?

Morpheus

Jack-of-Trades
Veteran
Joined
Mar 14, 2012
Messages
139
Reaction score
13
First Language
english
Primarily Uses
N/A
Image Here
Just trying to get the image on the left (The current script) to look like the mock up I made on the right.
Here is the small portion of the script for that section.

def draw_ingredients(y)
s1 = "Ingredients(Need/Have):"
x = 0
ny = 0
change_color(system_color)
draw_text(x, y, contents.width-x, line_height, s1)
change_color(normal_color)
x += text_size(s1).width
@recipe.ingredients.each do |ingredient|
@y_add += line_height
item = case ingredient.type
when :item; $data_items[ingredient.id]
when :weapon; $data_weapons[ingredient.id]
when :armor; $data_armors[ingredient.id]
when :gold; $imported["CSCA-CurrencySystem"] ? $game_party.get_csca_cs_currency(ingredient.id)[:currency_unit] : Vocab::currency_unit
end
if ingredient.type == :gold
change_color($game_party.get_csca_cs_currency(ingredient.id)[:color]) if $imported["CSCA-CurrencySystem"]
draw_text(x, y + ny, contents.width-x, line_height, sprintf("%d%s", ingredient.amount, item))
change_color(normal_color)
else
draw_icon(item.icon_index, x, y + ny)
x += 24
draw_text(x, y + ny, contents.width-x, line_height, sprintf("%s (%d/%2d)", item.name, ingredient.amount, $game_party.item_number(item)))
end
ny += line_height
x -= 24
end
end
 

Kuro DCupu

Trust me, I'm a veteran RMer
Veteran
Joined
Jul 6, 2014
Messages
311
Reaction score
1,176
First Language
Bahasa
Primarily Uses
RMMV
Sure...
def draw_ingredients(y)
s1 = "Ingredients(Need/Have):"
x = 0
ny = 0
change_color(system_color)
draw_text(x, y, contents.width-x, line_height, s1)
change_color(normal_color)
y += line_height
@recipe.ingredients.each do |ingredient|
@y_add += line_height
item = case ingredient.type
when :item; $data_items[ingredient.id]
when :weapon; $data_weapons[ingredient.id]
when :armor; $data_armors[ingredient.id]
when :gold; $imported["CSCA-CurrencySystem"] ? $game_party.get_csca_cs_currency(ingredient.id)[:currency_unit] : Vocab::currency_unit
end
if ingredient.type == :gold
change_color($game_party.get_csca_cs_currency(ingredient.id)[:color]) if $imported["CSCA-CurrencySystem"]
draw_text(x, y + ny, contents.width-x, line_height, sprintf("%d%s", ingredient.amount, item))
change_color(normal_color)
else
draw_icon(item.icon_index, x, y + ny)
x += 24
draw_text(x, y + ny, contents.width-x, line_height, sprintf("%s (%d/%2d)", item.name, ingredient.amount, $game_party.item_number(item)))
end
ny += line_height
x -= 24
end
end

What I did is just changing a single line.

FYI, I'm removing this :
x += text_size(s1).width

then replace it to this :
y += line_height

It should've worked as intention.
 
Last edited:

Morpheus

Jack-of-Trades
Veteran
Joined
Mar 14, 2012
Messages
139
Reaction score
13
First Language
english
Primarily Uses
N/A
Sure...

What I did is just changing a single line.

FYI, I'm removing this :
x += text_size(s1).width

then replace it to this :
y += line_height

It should've worked as intention.
I was going to say that now it overlaps the description text but I was able to fix it myself. Thank you so so much!
 
Last edited:

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Take care of your immune system: Go to sleep. If you looked at the clock an hour ago or four and it was way late then maybe now is the time. Mmm sleep...
Long time since last post but still here, still working on games. Hope everyone has been well.
Stream will be live shortly with a half-stream of Donkey Kong 64! Due to how late the TA started last stream, the second half will be the Text Adventure~ Feel free to drop by
I found a rat in my grain barrel this morning. I've seen lots of mice in there, but this is the first time I've seen a full-blown rat.

Forum statistics

Threads
95,661
Messages
930,867
Members
125,997
Latest member
Jaz_D3mon
Top