Forums WoW Modding Support Archives Azerothcore Discord Archives [DiscordArchive] How do you set the button text? As its own frame?

[DiscordArchive] How do you set the button text? As its own frame?

[DiscordArchive] How do you set the button text? As its own frame?

Pages (2): 1 2 Next
rektbyfaith
Administrator
0
04-02-2023, 02:12 PM
#1
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?
rektbyfaith
04-02-2023, 02:12 PM #1

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?

rektbyfaith
Administrator
0
04-02-2023, 02:14 PM
#2
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")
```
rektbyfaith
04-02-2023, 02:14 PM #2

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")
```

rektbyfaith
Administrator
0
04-02-2023, 02:15 PM
#3
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
rektbyfaith
04-02-2023, 02:15 PM #3

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

rektbyfaith
Administrator
0
04-02-2023, 02:16 PM
#4
Archived author: Mr.Sunshine • Posted: 2023-04-02T14:16:09.324000+00:00
Original source

I also tried with ButtonText, same result
rektbyfaith
04-02-2023, 02:16 PM #4

Archived author: Mr.Sunshine • Posted: 2023-04-02T14:16:09.324000+00:00
Original source

I also tried with ButtonText, same result

rektbyfaith
Administrator
0
04-02-2023, 02:20 PM
#5
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>
```
rektbyfaith
04-02-2023, 02:20 PM #5

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>
```

rektbyfaith
Administrator
0
04-02-2023, 02:21 PM
#6
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
rektbyfaith
04-02-2023, 02:21 PM #6

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

rektbyfaith
Administrator
0
04-02-2023, 02:21 PM
#7
Archived author: Foe • Posted: 2023-04-02T14:21:04.041000+00:00
Original source

yeah
rektbyfaith
04-02-2023, 02:21 PM #7

Archived author: Foe • Posted: 2023-04-02T14:21:04.041000+00:00
Original source

yeah

rektbyfaith
Administrator
0
04-02-2023, 02:21 PM
#8
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
rektbyfaith
04-02-2023, 02:21 PM #8

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

rektbyfaith
Administrator
0
04-02-2023, 02:23 PM
#9
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
rektbyfaith
04-02-2023, 02:23 PM #9

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

rektbyfaith
Administrator
0
04-02-2023, 02:24 PM
#10
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
rektbyfaith
04-02-2023, 02:24 PM #10

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

Pages (2): 1 2 Next
Recently Browsing
 1 Guest(s)
Recently Browsing
 1 Guest(s)