Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
blurymind opened this issue Jan 18, 2021 · 6 comments

Comments

@blurymind
Copy link

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
Copy link
Contributor

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
Copy link
Author

blurymind commented Feb 8, 2021

@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
Copy link
Contributor

LoganTann commented Feb 9, 2021

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
Copy link
Author

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

@LoganTann
Copy link
Contributor

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
Copy link
Author

blurymind commented Feb 21, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants