Forum Replies Created
-
AuthorPosts
-
nonameParticipant
Ah yes thanks for the hint. Now it works like intended. Thanks a lot.
Attachments:
You must be logged in to view attached files.nonameParticipantOkay when using the setInterval as Puzzleblock and not in the Code-Block it seems to work doing animations.
Attachments:
You must be logged in to view attached files.nonameParticipant@kdv77kdv
It’s more like a javaScript manipulated drawing.Example JsFiddle:
https://jsfiddle.net/7mvq29xa/1/var canvas = document.getElementById("myCanvas"); var c = canvas.getContext("2d"); var startX = 50; var startY = 50; var endX = 100; var endY = 100; var amount = 0; setInterval(function() { amount += 0.05; c.clearRect(0, 0, canvas.width, canvas.height); c.strokeStyle = "black"; c.moveTo(startX, startY); c.lineTo(startX + (endX - startX) * amount, startY + (endY - startY) * amount); c.stroke(); }, 30);
nonameParticipantSorry for having to ask again here @kdv77kdv
I was playing around with it but im not able to draw animations to the textures. Replacing the texture with a new static image is okay but how do I create an animation on it, using setInterval?
nonameParticipantThis works. Thank you much, sir!
nonameParticipantWow this is awsome. I tried your code and it works. However after testing a little I was not able to manipulate the canvas after the initial setup.
Lets say i want to clear the canvas and draw another Rect on it. Is that possible? My goal is to build like a little gameboy that runs with a html/javascript canvas and that you can also control with the real buttons on the 3d model.
Attachments:
You must be logged in to view attached files.nonameParticipantoh okay thanks i’ll solve it with javascript then. Do you know how to use ‘in parent docs’ in javascript? I need to control a html-element in parent docs inside my listener.
-
AuthorPosts