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!
- MathNotermans-96 months agoCommunity Member
I guess you have to be a bit patient till the new Advanced Javascript API for Storyline is public available. In there a lot of improvement on scaling of Javascript triggered elements in the SL player. Im gonna do some tests with WebObjects, Rive and JS to doublecheck this will work properly.
- MathNotermans-96 months agoCommunity Member
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?