Forum Discussion
Using Rive in Storyline - States
I have a hard time getting my Rive web object scaling with my slide. Even though my canvas dimensions are the same as the Storyline slide, my Rive animation appears larger when I publish, and has scroll bars on the side and bottom. The "Scale with slide option" seems to not be working at all. Any tips? Thank you!
Hi Victorien,
Thanks to ZevanRosser from Articulate i have a piece of code that will fix this.
You find it here.
https://zapp.codes/?share#rivesize
You basically need to add this part to your index.html of your Rive.
onresize = () => {
const size = Math.min(innerWidth, innerHeight) - 20
canvas.width = canvas.height = size
console.log('reszie')
r.resizeToCanvas();
}
onresize()
And then it will fit and resize nicely.
- VictorienRami-55 months agoCommunity Member
It seems it is working quite well. It will do for the moment. Tank you for you help!
Is it normal that Storyline does not play the Rive web object's sound events? My sounds are working just fine when I test my html file, but not in Storyline. Do you know if the Rive sound events have to be fired from JavaScript to work inside Storyline?