Convert, Get...

0 favourites
  • 6 posts
  • Hi, how to do it (Especially this one.):

    Get the color of the pixel at the mouse position.

    And this if you know:

    Get the value of Red (between 0 and 255) in a number (color), ex: Red (2456584) = 8

    Get the value of Green (between 0 and 255) in a number (color), ex: Green (2456584) = 37

    Get the value of Blue (between 0 and 255) in a number (color), ex: Blue (2456584) = 124

    Get the value of Alpha (between 0 and 255) in a number (color), ex: Alpha ( 2456584) = 0

    Convert an RGB or RGB color into a number, for example RGB (123, 45, 159) = 10431867, RGBA (123, 45, 159, 200) = 18446744072780459387

    Convert an entire hexadecimal value, for example, Hex (1234567890) = "499602D2".

    Convert a hexadecimal number into a number, e.g.: Val ("$ 10FFFFFFFFFFFFFFFF") = "73014444031".

    Conversion of an unsigned integer in a string, for example StrU (-929092229) = 18446744072780459387

    Convert a string into a number, for example Val ("102410241024102410241024102410241024") = "1024102410241024 '.

    Convert a character string in binary format into a number, for example Val ("% 1000") =" 8'.

    Convert a number into a single number, for example Bin (32) = "100000"

    Translated with deepl.com/Translator

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Doesn't anyone know? :(

  • For the first task you need Drawing Canvas object - paste your image onto the canvas, save snapshot, and then you can read pixel R G B A values from the snapshot.

    As for converting numbers etc. - some things may be possible with Construct expressions, for others you can use Javascript code.

    Set myNumber to Browser.ExecJS("......")

  • Thank you, do you have an example please ?

  • Thx :)

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)