mirror of
https://github.com/cyberarm/i-mic-fps.git
synced 2025-12-16 08:02:36 +00:00
Fixed multiple text y positioning
This commit is contained in:
@@ -5,7 +5,6 @@ class MultiLineText
|
|||||||
@texts = []
|
@texts = []
|
||||||
text.split("\n").each_with_index do |line, i|
|
text.split("\n").each_with_index do |line, i|
|
||||||
_options = options
|
_options = options
|
||||||
_options[:y]+=_options[:size]
|
|
||||||
@texts << Text.new(line, _options)
|
@texts << Text.new(line, _options)
|
||||||
end
|
end
|
||||||
@options = options
|
@options = options
|
||||||
@@ -46,12 +45,13 @@ class MultiLineText
|
|||||||
|
|
||||||
def y=(int)
|
def y=(int)
|
||||||
@y = int
|
@y = int
|
||||||
|
puts "Hi, #{int}"
|
||||||
@texts.each_with_index {|t, i| t.y=int+(i*t.size)}
|
@texts.each_with_index {|t, i| t.y=int+(i*t.size)}
|
||||||
end
|
end
|
||||||
|
|
||||||
def calculate_stack
|
def calculate_stack
|
||||||
@texts.each_with_index do |text, index|
|
@texts.each_with_index do |text, index|
|
||||||
text.y = text.size*index
|
text.y = (text.size*index)+@options[:y]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user