Heptagono's Recent Forum Activity

  • Hi,

    I have a calculator. It works with several variables which now I want to print. Yes, to print to an old classic sheet of paper. I know that you can use javascript to print some elements of a web page, for instance, with a function like this one: window.print()

    How could I use this on construct?

  • Well, It seems to be a very easy question, so I roll my sleeves up and start coding, but...

    what a surprise when I see that it doesn't works at all.

    Here is the interface:

    [attachment=2:34zs8mzk][/attachment:34zs8mzk]

    Here is the code:

    [attachment=1:34zs8mzk][/attachment:34zs8mzk]

    Explanation of the code: If I pick a button id=1 and I click on it, the other one id=2 must toggle state.

    The project is:

    [attachment=0:34zs8mzk][/attachment:34zs8mzk]

    Why does this happens?

    Do you think there is any logic problem here?

  • > Because when I turn it into an int() from a Str(), the 01 turns into a 1

    >

    Of course it does, in numbers you don't get 01. That is cosmetic 1 is 1

    01 = 0 because 0x1=0

    You can show user 01, but when you calculate you use 1.

    Example below is to show 01 to use 1 as calculation just add int(variable)

    That's right DUTOIT, It's an useful answer to understand better this issue. Thanks a lot!

  • hava a look at zeropad

    zeropad(4,2)= "04"

    ZEROPAD was the answer.

    RamPackWobble, thanks again!

  • Because when I turn it into an int() from a Str(), the 01 turns into a 1

  • Then, if I turn it into an INT, the zero disappears and everything fails.

  • Ok, Now it starts to work.

    What I've did?

    Create a Textbox and an Instance Variable Text Type.

    Then limit the number of characters in the TextBox to take only up to two.

    Define the value of the variable to these two characters

    Then send it to a Text to show it.

    But...¿What if I turn it into an int before make it visible on the Text element?

  • DUTOIT!

    Lol, I'm born to test your knowlegde about such a subject!

    I'm going to try it and I'll tell you.

    EDIT: It don't work.

  • TextBox, keep a 01 value to prevent it to turn into a 1.

    That's exactly what I'm trying to do. If I type in 01 and send that value to a variable, I obtain a 1.

    That's a disaster.

    Any idea on how to solve this? I haven´t seen this on the manual.

    Cheers!

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Set text to ---> Variable&"."&Variable

  • Can you modify the javascript from the plugin?

  • Perhaps you can use an Array of Sprites positions. And fill this variables value's with the places where you want to position the sprites. Could be a good idea?

Heptagono's avatar

Heptagono

Member since 25 May, 2012

None one is following Heptagono yet!

Trophy Case

  • 12-Year Club
  • x2
    Coach One of your tutorials has over 1,000 readers
  • Email Verified

Progress

14/44
How to earn trophies