Is the font color of the 'starling' bitmap not working?

.
Is the font color of the ‘starling’ bitmap not working?
.
Hey, I just used a “bitmap font creation” tool recommended by a friend to set up and export “bitmap fonts”.
.
A friend recommended a tool for creating bitmap fonts

.
Exported ‘bitmap font’


.
Does it not work when setting colors?

.
var bitmapFont:BitmapFont = assets.getBitmapFont(“Unnamed”);
TextField.registerCompositor(bitmapFont, bitmapFont.name);

		var textField:TextField = new TextField(300, 100, "100.00");
		textField.format.setTo(bitmapFont.name, 24, 0xC90F0F);
		textField.format.color = 0xff0000;
		addChild(textField);

.
Display effect
03
.

.
The font I exported is yellow


.
Why is it still displayed as black?
textField.format.setTo(bitmapFont.name, 100, Color.WHITE);
.

I gave feedback on a very strange phenomenon. At first, I didn’t use bitmap fonts. Today, I used bitmap fonts and exported the yellow font as shown above, but it kept displaying black. I don’t know if I deleted the “Export” folder or if I published another target. When I published H5 again, the bitmap font could display correctly.

.
Mmm! I have been studying alone for a day. I have resolved the issue with the font color of the bitmap. Novices need to note that if your font is colored, the text box color attribute should be set to white. If the exported font is white, you can use the text box to set any color.
.

In the project configuration file, I directly include all the resources of the entire folder, which is very convenient, isn’t it? But there is a problem, if I modify a texture file in the folder later and recompile H5, the resource will still be the same as before, so I need to delete the resources in the exported resource and compile it in order to update my resource. Research alone and provide feedback on any issues discovered.
.

I don’t know why, but I can’t send XML content. Even if I send it, is the XML content still blank or filtered out?
QQ20251007-183059

After careful consideration, at first, it seemed like I was exporting a black bitmap font because I was eager to test it and used the tool’s default color of black for export. Now, thinking about it, every time I compile, the resource texture is always the same as the original black bitmap font texture, because I include the entire folder of resources in the project file. It seems that this is the reason why the texture has not been updated

.
Novices can take a look at my implementation


.
var bitmapFont:BitmapFont = assets.getBitmapFont(“Unnamed”);
TextField.registerCompositor(bitmapFont, bitmapFont.name);

		var textField:TextField = new TextField(10, 10, "100.00");
		textField.autoSize = TextFieldAutoSize.BOTH_DIRECTIONS;
		textField.format.setTo(bitmapFont.name, 24 / 2, 0xFF9933);
		this.addChild(textField);

.
02
.

You could keep a blog or similar of your research, Studying alone is hard but if you can make your community more prolific and creative then it is really positive. Also what we learn and use one day we forget many months later, so one time you will be googling a problem and find your own previous solution!

1 Like

.
I am using a bitmap sequence diagram to synthesize bitmap text, but when displaying the text, the dots are incorrect? Did Xiaodian run up there? How to solve it?
.



03

The “100.00%” dot displayed above should be below, not above

Can you not make a tile sheet with the dot placed at the correct height, should be able to manually adjust in a package like Krita.

Because the size of each image character is different,
I tried to modify the. fnt data but it didn’t work

What did you use to create it?

Perhaps share the files, so we can help troubleshoot?

.
Upload original image
.
num_frame_0
num_frame_1
num_frame_2
.
Each image size is different
.




.
Point position error!
.
03
.

.

Are you able to share the respective fnt file also?

For some unknown reason, the published XML content is missing

<info face="sans-serif" size="72" bold="0" italic="0" charset="" unicode="1" stretchH="100"
        smooth="1" aa="1" padding="1,1,1,1" spacing="1,1" outline="0" />
    <common lineHeight="74" base="55" scaleW="54" scaleH="60" pages="1" packed="0" alphaChnl="0"
        redChnl="4" greenChnl="4" blueChnl="4" />
    <pages>
        <page id="0" file="Unnamed.png" />
    </pages>
    <chars count="4"><!--   -->
        <char id="32" x="0" y="0" width="0" height="0" xoffset="0" yoffset="0" xadvance="21"
            page="0" chnl="15" /><!-- . -->
        <char id="46" x="0" y="43" width="16" height="17" xoffset="1" yoffset="1" xadvance="18"
            page="0" chnl="15" /><!-- 0 -->
        <char id="48" x="0" y="0" width="31" height="42" xoffset="1" yoffset="1" xadvance="33"
            page="0" chnl="15" /><!-- 1 -->
        <char id="49" x="32" y="0" width="22" height="41" xoffset="1" yoffset="1" xadvance="24"
            page="0" chnl="15" />
    </chars>

When sharing XML code like that, perhaps try:

```xml
<xmltag>some xml text</xmltag>
```

Which produces:

<info face="sans-serif" size="72" bold="0" italic="0" charset="" unicode="1" stretchH="100"
        smooth="1" aa="1" padding="1,1,1,1" spacing="1,1" outline="0" />
<common lineHeight="74" base="55" scaleW="54" scaleH="60" pages="1" packed="0" alphaChnl="0"
        redChnl="4" greenChnl="4" blueChnl="4" />
<pages>
	<page id="0" file="Unnamed.png" />
</pages>
<chars count="4">
	<!--   -->
	<char id="32" x="0" y="0" width="0" height="0" xoffset="0" yoffset="0" xadvance="21"
            page="0" chnl="15" />
	<!-- . -->
	<char id="46" x="0" y="43" width="16" height="17" xoffset="1" yoffset="1" xadvance="18"
            page="0" chnl="15" />
	<!-- 0 -->
	<char id="48" x="0" y="0" width="31" height="42" xoffset="1" yoffset="1" xadvance="33"
            page="0" chnl="15" />
	<!-- 1 -->
	<char id="49" x="32" y="0" width="22" height="41" xoffset="1" yoffset="1" xadvance="24"
            page="0" chnl="15" />
</chars>

Can you please share the bitmap font image, the "Unamed.png" the fnt file is trying to access? What you shared here was 3 separate images.