User Tag List

Results 1 to 3 of 3

Thread: html5 float value issue

  1. #1
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Mac Export Module (Steam)Universal Windows Platform Export Module (Steam)SWF Export Module (Steam)Firefly 3D Module (Steam)

    Join Date
    Feb 2017
    Posts
    394
    Mentioned
    18 Post(s)
    Tagged
    0 Thread(s)

    html5 float value issue

    Hello, there is an issue when setting a float variable in html5, in windows android it works good why?

    Just look at the scale of the line in html5 you see what i mean, does not scale correct.

    if you divide the scale not by variable (varLineLength) but instead by 32.0 in the event itself then it works?!
    Attached files Attached files

  2. #2
    Clickteam Clickteam

    Join Date
    Jun 2006
    Location
    France
    Posts
    13,787
    Mentioned
    257 Post(s)
    Tagged
    3 Thread(s)
    I don't know if the HTML5 runtime can be modified so that it works exactly like the other runtimes in this case. In the other runtimes variables are typed (int or float), in HTML5 they have no type, this is a specificity of Javascript. The HTML5 runtime, to match the other runtimes, tries to detect if a variable is float or int. In your expression, the first part of the division is an integer (not sure why the distance expression returns an integer btw...), and has your variable as no decimals it thinks it's an integer so it does an integer division.

    The solution: multiply the first part of the epression by 1.0.

    Set X scale to ODistance( "obj1", X( "obj2" ), Y( "obj2" ) ) * 1.0 / varLineLength( "line" ) (Quality = 1)

  3. #3
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Mac Export Module (Steam)Universal Windows Platform Export Module (Steam)SWF Export Module (Steam)Firefly 3D Module (Steam)

    Join Date
    Feb 2017
    Posts
    394
    Mentioned
    18 Post(s)
    Tagged
    0 Thread(s)
    Ok thx thats a good solution

Similar Threads

  1. [HTML5 DSK]issue with readAFloat function
    By Xenon3000 in forum Extension Development
    Replies: 0
    Last Post: 22nd January 2020, 03:13 PM
  2. fast loop issue with html5 export
    By naud in forum HTML5 Export Module 2.5
    Replies: 3
    Last Post: 8th March 2017, 07:34 AM
  3. html5 export purple screen issue
    By bakkusa in forum HTML5 Export Module 2.5
    Replies: 9
    Last Post: 24th May 2015, 10:16 AM
  4. Free version - HTML5 build issue
    By Yves in forum HTML5 Export Module 2.5
    Replies: 5
    Last Post: 3rd December 2014, 05:51 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •