Author Topic: Text box for RPG  (Read 207 times)

captstu

  • Newbie
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Text box for RPG
« on: July 13, 2018, 06:43:10 am »
I'm rather new to working with Jo Engine, but I've been coding on my own personal projects for some time. Currently I'm attempting to make an RPG (turn based, JRPG inspired) and the first building block I'm on is text boxes. I was able to write some code regarding background draws and centering text, but that seemed silly when the Saturn can manage 4 sided polys.

Here's the dilema, though. I've got some code the centers the text and places it inside the poly's "box". However, as I move down the screen, the text eventually stops being centered and appears higher than the box. I'm sure it's something simple, and likely something I've overlooked, but I'm currently stumped.

TLDR: I can't get jo_3d_quad_tb and jo_printf to line up reliably.

Attached is screenshot and sample code. Feel free to point and laugh, I'm just hoping for a second set of eyes. :) Thanks in advance!

ponut64

  • Full Member
  • ***
  • Posts: 175
  • Karma: +13/-0
    • View Profile
Re: Text box for RPG
« Reply #1 on: July 13, 2018, 08:55:21 am »
Line 18 and 19:
Code: [Select]
	start_y -= 122;
stop_y -= 122;
//I added 10 because I am using a base of 352x240 instead of 320x240, concept will be the same

become instead:

Code: [Select]
	start_y -= 122 + (0.5 * given_y);
stop_y -= 122 + (0.5 * given_y);
//for 320x240, try starting at 112

Attached is a compiled sample.

captstu

  • Newbie
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Re: Text box for RPG
« Reply #2 on: July 15, 2018, 03:54:40 am »
Excellent, thank you. I'm going to continue to tweak further, but that's what I was missing.


 

Sitemap 1 2 3 4 5 6 7 8 9 10 
SMF spam blocked by CleanTalk