Hi!
I'm struggling to make text appear on a Sprite's bitmap, with the goal being to overlay a UI sprite with a value. I can make a child sprite to draw on assigned to that UI sprite, initialize its bitmap etc, even edit its bitmap with bitmap.fillAll, but I can't get text to display on it. The script I'm running looks like:
I've tried nudging the x and y to be positive and negative values, in case the text was just being drawn out of view, but with no luck.
And the following does work, so I know that the child bitmap is being drawn to the correct height and width and is correctly situated above the parent sprite:
I've also tried adding textColor and fontSize properties using the following, with no observable change:
Any help would be appreciated! can't find much discussion about bitmap.drawText online.
*Also, when I try to target enemy sprites with bitmap.drawText to test, I end up with similar results; no visible text is able to be drawn on the sprite with the way I'm writing the command (same as above.) On windows, I'm able to make bitmap.drawText display visibly as expected. Is what I'm trying to do even possible on Sprites?
I'm struggling to make text appear on a Sprite's bitmap, with the goal being to overlay a UI sprite with a value. I can make a child sprite to draw on assigned to that UI sprite, initialize its bitmap etc, even edit its bitmap with bitmap.fillAll, but I can't get text to display on it. The script I'm running looks like:
JavaScript:
uiSprite.children[0]._uiValue.bitmap.drawText(`test value`, 0, 4, 32, 32, `center`);
I've tried nudging the x and y to be positive and negative values, in case the text was just being drawn out of view, but with no luck.
And the following does work, so I know that the child bitmap is being drawn to the correct height and width and is correctly situated above the parent sprite:
Code:
uiSprite.children[0]._uiValue.bitmap.fillAll('rgba(0,0,0,0.1)');
I've also tried adding textColor and fontSize properties using the following, with no observable change:
Code:
this._uiValue.bitmap.textColor = '#ffffff';
this._uiValue.bitmap.fontSize = Window_Base.standardFontSize;
Any help would be appreciated! can't find much discussion about bitmap.drawText online.
*Also, when I try to target enemy sprites with bitmap.drawText to test, I end up with similar results; no visible text is able to be drawn on the sprite with the way I'm writing the command (same as above.) On windows, I'm able to make bitmap.drawText display visibly as expected. Is what I'm trying to do even possible on Sprites?