RPG Maker Forums

Hi everyone!


I'm trying to draw text on the map.


I did it by using a picture: here is how I do it:

  • Get the picture id
  • Create a new bitmap for the picture if there is none. The bitmap will be the size of the screen.
  • Display the picture at 0,0
  • Modify the picture bitmap by first clearing it, then drawing text at the x,y coordinates

Game_Screen.prototype.draw_text = function(id,text,x,y,align,width,height) {
width = width || 812
height = height || 624
align = align || "left"
var a = SceneManager._scene._spriteset._pictureContainer.children[id-1]
if (!a.bitmap) {
a.bitmap = new Bitmap(width,height)
}
$gameScreen.showPicture(id, '', 0, 0, 0, 100,100, 255, 0);
a.bitmap.clear()
a.bitmap.drawText(text ,x ,y ,width ,height ,align)
}


What i cannot comprehend is: why is the text displayed mid screen instead of at 0,0 ?


Here is how it looks:




The script call is:


$gameScreen.draw_text(2,"Alpha",0,0)



If you have any idea why I would be so grateful! I've been searching for hours.


Returning the y position of the picture returns 0 as it should. And by moving the picture to -312 I get the text where it should be. But I am writing on the image at 0,0 not 0,312 so why is the text displayed there?


The project I wrote the function on literally has only that plugin in it. Strictly default other than that, so no interference from any other plugin.


Gah. I don't understand, my function is logical, my script call is valid... Clearly I must be missing something.

Latest Threads

Latest Profile Posts

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.
Can someone recommend some fun story-heavy RPGs to me? Coming up with good gameplay is a nightmare! I was thinking of making some gameplay platforming-based, but that doesn't work well in RPG form*. I also was thinking of removing battles, but that would be too much like OneShot. I don't even know how to make good puzzles!
one bad plugin combo later and one of my followers is moonwalking off the screen on his own... I didn't even more yet on the new map lol.

Forum statistics

Threads
106,034
Messages
1,018,446
Members
137,820
Latest member
georg09byron
Top