[DiscordArchive] How do you set the button text? As its own frame?
[DiscordArchive] How do you set the button text? As its own frame?
Archived author: Foe • Posted: 2023-04-02T14:12:51.054000+00:00
Original source
How do you set the button text? As its own frame?
Archived author: Mr.Sunshine • Posted: 2023-04-02T14:14:32.651000+00:00
Original source
```xml
<Button name="ACGMISideMenuTabBtnTemplate" virtual="true">
<Size>
<AbsDimension x="135" y="30"/>
</Size>
<NormalTexture>
<Color r="0.12" g="0.43" b="0.6" a="1.0" />
</NormalTexture>
<PushedTexture>
<Color r="0.12" g="0.43" b="0.6" a="1.0" />
</PushedTexture>
<DisabledTexture>
<Color r="0.12" g="0.43" b="0.6" a="1.0" />
</DisabledTexture>
<HighlightTexture>
<Color r="0.12" g="0.43" b="0.6" a="1.0" />
</HighlightTexture>
<Anchors>
<Anchor point="CENTER" />
</Anchors>
<Layers>
<Layer level="OVERLAY">
<FontString font="SystemFont_Med2" parentKey="Label" text="ButtonText">
<Color r="1.0" g="1.0." b="1.0" />
</FontString>
</Layer>
</Layers>
</Button>
```
And then I create the button with
```lua
local testButton = CreateFrame("Button", "TestName", mainFrame.SideMenuNav, "ACGMISideMenuTabBtnTemplate")
```
Archived author: Foe • Posted: 2023-04-02T14:15:17.776000+00:00
Original source
Yeah that won't work properly, the overlay strata is lower than the highlight strata
Archived author: Mr.Sunshine • Posted: 2023-04-02T14:16:09.324000+00:00
Original source
I also tried with ButtonText, same result
Archived author: Mr.Sunshine • Posted: 2023-04-02T14:20:58.541000+00:00
Original source
Yeah seems I got it working with
```xml
<Button name="ACGMISideMenuTabBtnTemplate" virtual="true">
<Size>
<AbsDimension x="135" y="30"/>
</Size>
<NormalTexture>
<Color r="0.0" g="0.0" b="0.0" a="0.0" />
</NormalTexture>
<PushedTexture>
<Color r="0.12" g="0.43" b="0.6" a="1.0" />
</PushedTexture>
<DisabledTexture>
<Color r="0.12" g="0.43" b="0.6" a="1.0" />
</DisabledTexture>
<HighlightTexture>
<Color r="0.12" g="0.43" b="0.6" a="1.0" />
</HighlightTexture>
<Anchors>
<Anchor point="CENTER" />
</Anchors>
<Layers>
<Layer level="OVERLAY">
<FontString font="SystemFont_Med2" parentKey="Label" text="ButtonText">
<Color r="1.0" g="1.0." b="1.0" />
</FontString>
</Layer>
<Layer level="HIGHLIGHT">
<FontString font="SystemFont_Med2" parentKey="Label" text="ButtonText">
<Color r="1.0" g="1.0." b="1.0" />
</FontString>
</Layer>
</Layers>
</Button>
```
Archived author: Foe • Posted: 2023-04-02T14:21:00.447000+00:00
Original source
By using your own custom template you'll have to port over the same functionality from the base button templates
Archived author: Foe • Posted: 2023-04-02T14:21:04.041000+00:00
Original source
yeah
Archived author: Foe • Posted: 2023-04-02T14:21:36.178000+00:00
Original source
There's also disabled and clicked that you'll also probably want to port
Archived author: Foe • Posted: 2023-04-02T14:23:50.549000+00:00
Original source
with using both stratas like you do now though, whenever you're not hovering, the text will be brighter/bolder
Archived author: Mr.Sunshine • Posted: 2023-04-02T14:24:45.500000+00:00
Original source
If I didn't keep the OVERLAY layer, the text wouldn't display when in normal state