forked from noxious/client
Firefox styling fixes
This commit is contained in:
parent
856829b605
commit
252d9c87fd
@ -1,12 +1,12 @@
|
|||||||
<template>
|
<template>
|
||||||
<!-- Chat bubble -->
|
<!-- Chat bubble -->
|
||||||
<Container ref="charChatContainer" :depth="999" :x="currentX" :y="currentY">
|
<Container ref="charChatContainer" :depth="999" :x="currentX" :y="currentY">
|
||||||
<RoundRectangle @create="createChatBubble" :origin-x="0.5" :origin-y="7.5" :fillColor="0xffffff" :width="194" :hHAeight="21" :radius="20" />
|
<RoundRectangle @create="createChatBubble" :origin-x="0.5" :origin-y="7.5" :fillColor="0xffffff" :width="194" :height="21" :radius="20" />
|
||||||
<Text @create="createChatText" :style="{ fontSize: 13, fontFamily: 'Arial', color: '#000' }" />
|
<Text @create="createChatText" :style="{ fontSize: 13, fontFamily: 'Arial', color: '#000' }" />
|
||||||
</Container>
|
</Container>
|
||||||
<!-- Character name and health -->
|
<!-- Character name and health -->
|
||||||
<Container :depth="999" :x="currentX" :y="currentY">
|
<Container :depth="999" :x="currentX" :y="currentY">
|
||||||
<Text @create="createText" :text="character.name" />
|
<Text @create="createNicknameText" :text="character.name" />
|
||||||
<RoundRectangle :origin-x="0.5" :origin-y="18.5" :fillColor="0xffffff" :width="74" :height="6" :radius="5" />
|
<RoundRectangle :origin-x="0.5" :origin-y="18.5" :fillColor="0xffffff" :width="74" :height="6" :radius="5" />
|
||||||
<RoundRectangle :origin-x="0.5" :origin-y="36.4" :fillColor="0x00b3b3" :width="70" :height="3" :radius="5" />
|
<RoundRectangle :origin-x="0.5" :origin-y="36.4" :fillColor="0x00b3b3" :width="70" :height="3" :radius="5" />
|
||||||
</Container>
|
</Container>
|
||||||
@ -144,10 +144,14 @@ const createChatText = (text: Phaser.GameObjects.Text) => {
|
|||||||
// Fix text alignment on Windows and Android
|
// Fix text alignment on Windows and Android
|
||||||
if (game.device.os.windows || game.device.os.android) {
|
if (game.device.os.windows || game.device.os.android) {
|
||||||
text.setOrigin(0.5, 9.75)
|
text.setOrigin(0.5, 9.75)
|
||||||
|
|
||||||
|
if (game.device.browser.firefox) {
|
||||||
|
text.setOrigin(0.5, 10.9)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const createText = (text: Phaser.GameObjects.Text) => {
|
const createNicknameText = (text: Phaser.GameObjects.Text) => {
|
||||||
text.setFontSize(13)
|
text.setFontSize(13)
|
||||||
text.setFontFamily('Arial')
|
text.setFontFamily('Arial')
|
||||||
text.setOrigin(0.5, 9)
|
text.setOrigin(0.5, 9)
|
||||||
@ -155,6 +159,10 @@ const createText = (text: Phaser.GameObjects.Text) => {
|
|||||||
// Fix text alignment on Windows and Android
|
// Fix text alignment on Windows and Android
|
||||||
if (game.device.os.windows || game.device.os.android) {
|
if (game.device.os.windows || game.device.os.android) {
|
||||||
text.setOrigin(0.5, 8)
|
text.setOrigin(0.5, 8)
|
||||||
|
|
||||||
|
if (game.device.browser.firefox) {
|
||||||
|
text.setOrigin(0.5, 9)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user