Monogatari / Monogatari

Monogatari is a simple web visual novel engine, created to bring Visual Novels to the web.
https://monogatari.io/
MIT License
730 stars 123 forks source link

Spritesheet and other animations that dont have an ugly video player frame? #131

Open blurymind opened 3 years ago

blurymind commented 3 years ago

Is it possible to declare a spritesheet and control its animation speed/play/loop via script?

Lets say we want an animation, but we do not want the ugly video player frame. A webm file can have an alpha channel. Is it possible to get rid of the video player frame and control the webm's playback via script?

LoganTann commented 3 years ago

Hello, sorry for the late reply

There are multiple ways, that depends on how you are coding your game. What you are asking is "how to show a video without borders and controls" ?

Here are the supported configs you can use with the show video action : modal, immersive, background and fullscreen. I think immersive is what you need, but this covers the whole screen. You might need to edit the CSS to set the correct size/position of the video.

For a spritesheet animation, a simple div with a background image does the job (it might not be responsive though). Or you can also use a canvas.

Keep in mind that SVG can be used as an image (it can be a character sprite for example), it's sometimes useful for basic animations. However, inside an image tag, you can't really control it using JavaScript. In this case, you can directly add it inside/over the HTML of the game.

blurymind commented 3 years ago

@LoganTann are there any existing examples of how this can be achieved? For example a clickable image sprite that starts a conversation with the character on that sprite?

Lets say we want to simulate a room with 2 or more characters/items that can be interacted with by clicking on them.

Or even just a simple looping spritesheet for a character avatar (blink animations?)

LoganTann commented 3 years ago

are there any existing examples of how this can be achieved?

It really depends what you need. My own games adds a html container that overlays the game screen when I need something that monogatari can't do (eg. acessing to the protagonist's PC to read his mails)

I've seen examples of point and click in discord, this requires to force the aspect ratio because it uses CSS to position the choices buttons at the exact percentage position in the screen : https://newrem.com/monogatari/helpExamples/pointAndClickAdventureExampleInvisible/

blink animations

i'd embed the images [without eyes + open eyes + closed eyes] inside a SVG image that contains a CSS animation to toggle the closed and opened eyes.

blurymind commented 3 years ago

its a nice example but its not source code on github :)

LoganTann commented 3 years ago

its a nice example but its not source code on github :)

I just noticed I misunderstood what you're looking for : characters with blinking eyes, clickable characters instead of traditional choices. Actually, there is not such examples I know in github. I still have an idea on how to do this, but it will require some time to create it. I'll reply to this issue once it's done (don't hesitate to reply if you have found a solution by yourself).

Hyuchia created a repository dedicated for templates or examples created by the community (https://github.com/Monogatari/Community), maybe I would create this example there ?

blurymind commented 3 years ago

Yes an example template would be most helpful. I will appreciate it greatly :)

On Sat, 20 Feb 2021, 13:17 ShinProg (Logan Tann), notifications@github.com wrote:

its a nice example but its not source code on github :)

I just noticed I misunderstood what you're looking for : characters with blinking eyes, clickable characters instead of traditional choices. Actually, there is not such examples I know in github. I still have an idea on how to do this, but it will require some time to create it. I'll reply to this issue once it's done (don't hesitate to reply if you have found a solution by yourself).

Hyuchia created a repository dedicated for templates or examples created by the community (https://github.com/Monogatari/Community), maybe I would create this example there ?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Monogatari/Monogatari/issues/131#issuecomment-782649874, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABRRWVLMHILMBFXPESCLAULS76Y6HANCNFSM4WHVPWKQ .