≡
Products
▼
Support
▼
Company
▼
Forum
Ambiera Forum
Discussions, Help and Support.
Create a new account
,
Search
, or Login:
Create reply in
Is there a "delta" type thing in Coppercube's script to test for actual time ?
Posted by:
(you are not logged in)
Enter the missing letter in: "In?ernational"
(you are not logged in)
Text:
[quote][b][/b] wrote: It's ok, I have fixed it ! Sorry, Looks like my delta time retrieval function works !!! <!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Delta Time</title> <style type="text/css"> body,td,th { font-family: consolas; font-weight:bold; font-size: 50px; color: F90; } body { border:0; margin:0; padding:0; background-color: 000; overflow:hidden; } container { width:100vw; height:100vh; display:grid; place-items:center; } delta_Time { color:7f84ff; } </style> <script src="jquery-1.11.1.min.js"></script> <script> var Delta_Time_Last_Update = Date.now(); var Delta_Time_Now = 0; var Delta_Time = 0; var delta_time_enterframe_handle = requestAnimationFrame(delta_time_enterframe); function delta_time_enterframe(event) { Delta_Time_Now = Date.now(); Delta_Time = (Delta_Time_Now - Delta_Time_Last_Update) / (1000/60); Delta_Time_Last_Update = Delta_Time_Now; $("delta_Time").html(Delta_Time); $("ball").css("left",(parseFloat($("ball").css("left").replace(/[^-\d\.]/g, ''))+(0.2 * Delta_Time))+"px"); console.log($("ball").css("left").replace(/[^-\d\.]/g, '')); delta_time_enterframe_handle = requestAnimationFrame(delta_time_enterframe); //cancelAnimationFrame(delta_time_enterframe_handle); } </script> </head> <body> <div id="container"> <table width="800px" border="1"> <tr> <td align="right" style="color:cc99cc;" width="330px">Delta Time:</td> <td> <div id="delta_Time" style="margin-left:7px;"> 0000 </div> </td> </tr> </table> </div> <div id="ball" style="position:absolute; left:10px; top:10px; background-color:0F0; width:100px; height:100px; border-radius:100px;"></div> </body> </html>[/quote]
Possible Codes
Feature
Code
Link
[url] www.example.com [/url]
Bold
[b]bold text[/b]
Image
[img]http://www.example.com/image.jpg[/img]
Quote
[quote]quoted text[/quote]
Code
[code]source code[/code]
Emoticons
Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact