Question: relative positioning #460
-
|
Hello! Is there a way to position images relative to other images? For example, in your template project, there is an anime character and the eye image is a separate large image, where only a small part is actually the eyes and the rest is just empty space. This can have a serious impact on memory usage. I was wondering if it is possible to move the eyes to a separate, smaller image and then somehow tell the renderer with ink hashtag to draw the eyes at specific x, y coordinates inside the character's image? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
|
I assume you're using ink, right? In Typescript, however, you can. You just create the image components separately and then add them to the container. I don't think I want to add something similar to ink because it would greatly complicate the script syntax. If you want, you can always create custom scripts https://pixi-vn.web.app/it/ink/hashtag to add custom logic designed just for your game. (I should look into this further) In theory, the invisible space on .png images (or another modern format) shouldn't significantly increase the image space. |
Beta Was this translation helpful? Give feedback.
I'm not sure what you want to do. But I assume the answer is no. What exactly is the purpose?
Now, I don't know your exact experience with web projects. However, in pixi-vn projects, you can add "graphic elements" in two places:
In the canvas, you can add text with the Text element (the same way you add an image). Currently, since I've never personally used the Text element and it's never been requested, I've tested it very little. In any case, there's currently no way to add this element with ink. But that's m…