Jo Engine Forum

Sega Saturn Development => General Jo Engine Help => Topic started by: captstu on July 13, 2018, 06:43:10 am

Title: Text box for RPG
Post by: captstu 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!
Title: Re: Text box for RPG
Post by: ponut64 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.
Title: Re: Text box for RPG
Post by: captstu 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.