xboxscene.org forums

Author Topic: Text/font Question  (Read 42 times)

BenJeremy

  • Archived User
  • Hero Member
  • *
  • Posts: 5645
Text/font Question
« on: November 25, 2003, 01:37:00 AM »

QUOTE (49er @ Nov 25 2003, 04:25 AM)
I want to add some custom text - "TRACK" - using a custom font, so I put something like this in my skin:

<LayoutElement Type="Text" Font="Impact_18.xpr">
     <Color>0x80FFFFFF</Color>
     <Constant>TRACK</Constant>
     <Pos x=200 y=200>
     <Justify x=left y=center>
</LayoutElement>

When I load the skin, it shows the text in the default font.

(I can use the custom font for text that is sourced e.g. DateTime, but not with the <Constant> tag).

Any ideas?

Fonts have to be defined as a resource, then you use the resource name to identify the font.
Logged

BenJeremy

  • Archived User
  • Hero Member
  • *
  • Posts: 5645
Text/font Question
« Reply #1 on: November 25, 2003, 03:46:00 AM »

QUOTE (49er @ Nov 25 2003, 07:23 AM)
Hi - thanks for the reply.

Just to be absolutely clear:-

- I've named the font as a resource.

- It works with
<LayoutElement Type="Text" Source="DateTime" Font="Impact_18.xpr">
...
</LayoutElement>


- I can't get it to work with
]<LayoutElement Type="Text" Font="Impact_18.xpr">
<Constant>my custom text here</Constant>
...
</LayoutElement>


I must be missing something - I'll check again for typos when I get home.

(Great dash BTW)

?? No, that shouldn't work, neither element.

CODE

 
   Impact_18.xpr
 



Then:

CODE


0x80FFFFFF
TRACK





You must use the RESOURCE NAME for the element to be able to reference the font. This was done to conserve and consolidate resources. It also makes it a snap to make changes to the fonts, for example, without having to change a bunch of locations in the skin file.
Logged