New account registration is temporarily disabled.

[RMVX ACE] DRAW_TEXT CREATING ODD OVERLAPPING TEXT.

Posts

Pages: 1
Because apparently I like putting my stupid mistakes up on the forums!

So, everything is working grand, we're reading from the array, we're changing what is displayed based on the array! Except, for, well...



It looks like the text is wrapping over and over itself. The other strings display fine, but they are only examples and as such very short.

Here is where I declared what is in the string. Note, I've already tried applying line breaks to it, no joy.

$mission[0] = Mission.new(1, 10, 10, 10, 8, 0, "Alley", 
    "We are receiving a distress call from an Alley in Paris.
    Our scans indicate a Wyrd signature, along with several
    readings of undead in the area. Recover the individual
    and report back to base.")

And here is the function to draw the description in the window.

class Window_MissionDesc < Window_Base
  def initialize(list_window, x, y, width, height)
    super(x, y, width, height)
    @list_window = list_window
    @list = @list_window.item
    @width = width
    @height = height
    draw_desc(x, y, @list)
    refresh
  end
  def draw_desc(x, y, list)
    draw_text(0, 0, width, height, list.desc)
  end
  
  def update
    super
    refresh
  end
  
  def refresh
    contents.clear
    @list = @list_window.item
    draw_desc(0, 0, @list)
  end
end

I'm guessing its either an issue with how the text is stored, or with draw_text and its parameters, but no joy so far in finding any similar thread. Sorry for troubling people with my issues again!
pianotm
The TM is for Totally Magical.
32388
I don't know Ruby, but don't you have to include line breaks, margins, and spacing points in your text?
For example, in HTML, I'd write like this:

<left>"We are receiving a distress call from an Alley in Paris.<br>
Our scans indicate a Wyrd signature, along with several<br>
readings of undead in the area. Recover the individual<br></left>
Indeed, and I already tried to include line breaks, \n and \\n, neither did anything to the text. I could be using the wrong sort of line breaks, but I don't know which to use.
Yeah, I came across that while I was looking as well. Unfortunately that particular one is using puts, which we don't use in VXACE, at the level I'm at at least, and the same one also suggested the \\n line breaks, which did nothing to my output.
pianotm
The TM is for Totally Magical.
32388
I'm sorry, I just don't know about it, but I can only say that that text overlap definitely looks like a simple formatting error.
No problem, I figure its that as well. If there's anything I keep getting tripped up over its silly, stupid little mistakes :P

Edit: As a note, went back and triple checked, tried \n, \\n, \r, //n, and /n, no luck
Change your draw_desc function to iterate through your description string via for-loop. Then, have a variable within the loop that increments every iteration tp determine which line in the array to print, and the line's y-value.

something like this:

var = 0
for line in desc
  draw_text(0, line_height * var, width, line_height, desc[var])
  var+=1
end
Though with this setup, you're going to have to make your description an array like this:
{"Line one is here!", "But line two can't come...", "Too bad, huh?"}
To print out:
Line one is here!
But line two can't come...
Too bad, huh?

Edit: If you want to use escape characters, use draw_text_ex instead.
Thanks for the help, didn't realize it was that complicated just to get the thing to write a single long line of text and wrap it.

Thanks for your help!
No prob. I wasn't much help in your previous topic so...

I think your text overlapped because you did not change the y-value of your draw_text. Though it's strange that the text was drawn in the middle of the window instead of on the upper part (since you did put 0).
I actually changed every value, to see what was going on with it. The y didn't matter, nor did the height/width, etc etc. I actually went ahead to make things easier and started using KilloZappit's wrapping message windows script, so I don't have to hand linebreak every description.
Pages: 1