-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
style: improve scroll bar styling and add yellow text element
- Improved the styling of the scroll bar in the PixiJSContainer component to have a higher z-index. - Added a new yellow text element (YellowText) in main.ts to easily create PixiJS Text objects with yellow fill. - Removed unnecessary imports from index.ts and moved them to main.ts.
- Loading branch information
Mr.Mao
committed
Jun 4, 2023
1 parent
ca402a7
commit 58be2a0
Showing
13 changed files
with
202 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import FloatingVue from 'floating-vue' | ||
import { renderer } from 'vue3-pixi' | ||
import { Text } from 'pixi.js' | ||
|
||
import 'floating-vue/dist/style.css' | ||
import 'uno.css' | ||
import './style.css' | ||
|
||
class YellowText extends Text { | ||
constructor(text, style) { | ||
super(text, style) | ||
this.style.fill = 'yellow' | ||
} | ||
} | ||
|
||
const elements = { | ||
YellowText: props => new YellowText(props.text, props.style), | ||
} | ||
|
||
renderer.use({ elements }) | ||
|
||
FloatingVue.options.distance = 28 | ||
FloatingVue.options.themes.tooltip.delay.show = 100 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<template> | ||
<yellow-text text="Hello World" :anchor="0.5" :x="120" :y="120" /> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<script lang="ts" setup> | ||
import { onMounted, ref } from 'vue' | ||
import type { TextInst } from 'vue3-pixi' | ||
const textRef = ref<TextInst>() | ||
onMounted(() => { | ||
textRef.value!.style.fill = 'yellow' | ||
}) | ||
</script> | ||
|
||
<template> | ||
<text ref="textRef" :anchor="0.5" :x="120" :y="120"> | ||
Hello World | ||
</text> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<script lang=ts setup> | ||
import { reactive } from 'vue' | ||
import { onTick } from 'vue3-pixi' | ||
const position = reactive({ x: 120, y: 120 }) | ||
let count = 0 | ||
onTick((delta) => { | ||
count += delta * 0.05 | ||
position.x = 120 + Math.cos(count) * 50 | ||
position.y = 120 + Math.sin(count) * 50 | ||
}) | ||
</script> | ||
|
||
<template> | ||
<sprite | ||
texture="/assets/food/lemonpie.png" | ||
:position="position" | ||
:anchor="0.5" | ||
:scale="1.4" | ||
/> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
58be2a0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
vue3-pixi – ./
vue3-pixi-tuimao.vercel.app
vue3-pixi.vercel.app
vue3-pixi-git-main-tuimao.vercel.app