Help - Search - Members - Calendar
Full Version: Working with text and text boxes
RPG RPG Revolution Forums > Game Engines > RPG Maker XP Discussion
Draze
Hey guys, just discovered this forum and think its really cool. Then I started working again and found a problem and decided to ask it here tongue.gif Just some background on where I'm coming from: I am a college student currently learning C++ and I would love to continue on to create games at a more serious level. However I don't have much coding experience so I am pretty new at this.

Ok here's the problem. I've been messing around with the text box and the coordinates of where it goes but I can't seem to find where to make the text inside the text box match the coordinates I set for the text box. Is there any way to do this?

EDIT: Since I'm asking... is there any way to make the text only show... say two lines at a time? instead of all four? I'd like a thinner text box but it was cutting off the text. (This may even work with the fix that i need in the first place tongue.gif)



Thanks!

(Also, I don't know if I am allowed to ask this here but I thought I may as well instead of taking up more space on the forums tongue.gif I see cool stuff in the gallery, can we use that in games we plan on marketing? Or can they just be used for fun?)
Jens of Zanicuud
First of all, welcome RRR wink.gif
I'll try asking your questions properly.

1. Window_Message y is decided here: class Window_Message, line 170 on:
CODE
def reset_window
    if $game_temp.in_battle
      self.y = 16
    else
      case $game_system.message_position
      when 0
        self.y = 16
      when 1
        self.y = 160
      when 2
        self.y = 304
      end
    end
    if $game_system.message_frame == 0
      self.opacity = 255
    else
      self.opacity = 0
    end
    self.back_opacity = 160
  end


0 is referred to the top window position,
1 is referred to the middle window position,
2 is referred to the bottom window position.

Modify the y values here to move your window where you wish to;

2. Sure, you can resize the message window here: Window_Message, line 12:
CODE
super(80, 304, 480, 160)

Just modify that 160 with the number you like wink.gif
Remember that 32 pixels are always lost because of padding.
Anyway, remember that this solution will crop away the exceeding lines of text.
To use all the lines and then subdivide the text into two windows, you'd need a more refined script.

3. Gallery items belong to the user who opened it. To use them in commercial games, you have to ask the submitter via PM. Different people could have different reactions about it.

I hope this could help,

Jens
Draze
Thanks so much smile.gif I really appreciate it!

EDIT: Hey is there anyway to Center the text? For example, my text box is very long and I don't want it to be all on one side like it is now. Thanks biggrin.gif

EDIT2: Man I'm going to have so much trouble being good XD. Ok, is it possible that a picture can show up on top of the textbox?
Jens of Zanicuud
QUOTE (Draze @ Feb 27 2013, 06:43 PM) *
Thanks so much smile.gif I really appreciate it!

EDIT: Hey is there anyway to Center the text? For example, my text box is very long and I don't want it to be all on one side like it is now. Thanks biggrin.gif

EDIT2: Man I'm going to have so much trouble being good XD. Ok, is it possible that a picture can show up on top of the textbox?


You should modify the Window_Message script, this way it would be actually possible to made both of these things wink.gif
This isn't too much difficult, but it could require some try.

I'll think about it and then post an answer in the next days...

Jens
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2013 Invision Power Services, Inc.