A little help with drawText

Orichalcum+

Veteran
Veteran
Joined
Apr 17, 2015
Messages
72
Reaction score
52
First Language
English
Primarily Uses
Im trying to draw text on a bitmap and I can't seem to get it to show up, here's what I'm working with so far. Im not sure if it's relevant or not but this is "Scene_Map" By the way.
Code:
A = new Sprite();
A.bitmap = ImageManager.LoadImage("Bar")
A.bitmap.drawText("test", 0, 0, 100, 30, 'center')
SceneManager._scene.addChild(A)
A.x = 100
A.y = 100
The Bar image shows up just fine, but there isn't any text anywhere on the screen. Can anyone tell me what i'm doing wrong?
 
Last edited:

gstv87

Veteran
Veteran
Joined
Oct 20, 2015
Messages
2,254
Reaction score
1,254
First Language
Spanish
Primarily Uses
RMVXA
try positioning A before drawing the Text.
 

Orichalcum+

Veteran
Veteran
Joined
Apr 17, 2015
Messages
72
Reaction score
52
First Language
English
Primarily Uses
What do you mean by size? Sorry i'm still new to this.
 

gstv87

Veteran
Veteran
Joined
Oct 20, 2015
Messages
2,254
Reaction score
1,254
First Language
Spanish
Primarily Uses
RMVXA
just position, I edited the size part out, I realized if you see the image you were loading, then the sprite is sized correctly.
it might be that moving the sprite is causing the text to not reload correctly.
to be on the safe side, first position the X and Y, and then draw on top of it.
 

Orichalcum+

Veteran
Veteran
Joined
Apr 17, 2015
Messages
72
Reaction score
52
First Language
English
Primarily Uses
Nope, that didn't work for me either. Im gonna disable the plugins I have to make sure it isn't one of those.
 

Poryg

Dark Lord of the Castle of Javascreeps
Veteran
Joined
Mar 23, 2017
Messages
4,125
Reaction score
10,640
First Language
Czech
Primarily Uses
RMMV
Sprite is a subclass of PIXI.Sprite and its bitmap has nothing to do with Bitmap class. Therefore it shouldn't be possible to use Bitmap prototype methods as far as I know.

I would use PIXI.Text instead:

var text = new PIXI.Text("test", style);
var style = {fontFamily: "GameFont", fontSize:28, color: 0xffffff}
A.addChild(text)
 
Last edited:

gstv87

Veteran
Veteran
Joined
Oct 20, 2015
Messages
2,254
Reaction score
1,254
First Language
Spanish
Primarily Uses
RMVXA
but he's loading an actual bitmap, as the sprite's bitmap.
 

Orichalcum+

Veteran
Veteran
Joined
Apr 17, 2015
Messages
72
Reaction score
52
First Language
English
Primarily Uses
I was just about to ask if there was another method you guys would recommend.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Day 9 of giveaways! 8 prizes today :D
He mad, but he cute :kaopride:

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.

Forum statistics

Threads
106,040
Messages
1,018,470
Members
137,821
Latest member
Capterson
Top