forked from noxious/client
Possible fix for text alignment on Windows
This commit is contained in:
parent
a0f0b40ed3
commit
856829b605
@ -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" :height="21" :radius="20" />
|
<RoundRectangle @create="createChatBubble" :origin-x="0.5" :origin-y="7.5" :fillColor="0xffffff" :width="194" :hHAeight="21" :radius="20" />
|
||||||
<Text @create="createChatText" text="" :origin-x="0.5" :origin-y="10.9" :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" :origin-x="0.5" :origin-y="9" />
|
<Text @create="createText" :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>
|
||||||
@ -139,6 +139,7 @@ const createChatText = (text: Phaser.GameObjects.Text) => {
|
|||||||
text.setName(`${props.character.name}_chatText`)
|
text.setName(`${props.character.name}_chatText`)
|
||||||
text.setFontSize(13)
|
text.setFontSize(13)
|
||||||
text.setFontFamily('Arial')
|
text.setFontFamily('Arial')
|
||||||
|
text.setOrigin(0.5, 10.9)
|
||||||
|
|
||||||
// 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) {
|
||||||
@ -149,6 +150,7 @@ const createChatText = (text: Phaser.GameObjects.Text) => {
|
|||||||
const createText = (text: Phaser.GameObjects.Text) => {
|
const createText = (text: Phaser.GameObjects.Text) => {
|
||||||
text.setFontSize(13)
|
text.setFontSize(13)
|
||||||
text.setFontFamily('Arial')
|
text.setFontFamily('Arial')
|
||||||
|
text.setOrigin(0.5, 9)
|
||||||
|
|
||||||
// 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) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user