XHXIAIEIN's Recent Forum Activity

  • Thank you for your great work!!

    I think it would be perfect for a game like Choice of Life: Middle Ages and Yes, Your Grace and Sort The Court and Pilgrims

    ----

    I have a few polishing ideas:

    • New r373

      8. When Output is selected, the context menu use 'Remove' output to distinguish 'Delete' Node options

      I had a bold idea, if Flowcharts can work like JsonCrack?

      jsoncrack (github)

      1. Add a format button, Automatically sort node, no need to manually organize spaghetti.

      2. displayed as JSON (without editor node data)

      the editor's zoom and search functions also make sense.

      1. Zoom to fit

      2. Collapse Nodes

      3. Focus to First Node

      4. Search Node

    • Tab 1

      Content

    • Archived

      7. If the node can be named, it will help better manage the flowchart page

      6. Allow top-down organizational structure (Flowchart properties)bold text

      5. Context Menu on Out component Add a 'Go to' function, allowing the editor to focus on nodes.

      4. importing/export the flowchart AsJSON for external editing. If it can converted to data files, it would be even cooler! people can write flowchart data from external excel and import it into the flowchart with just a simple work.

      3. Allow 'Add Output' in the property bar (like add instance variables) which can better utilize the working habits of Construct

      the same context applies to nodes

      2.delete confirmation

      1. When dragging the node, keeping the output width small, But rather drag the column of Value.

    -

  • C3 plug-ins are stored in the browser cache. If you clear the browser cache, the data will not exist.

    But you can check Bundle addons in the project properties, it can help you store the third-party add-ons used in the project along with the project file.

  • That doesn't usually happen, did you manually clear the browser cache? Or using a different browser ?

  • This is very simple in C3.

    Use build-in Date Plugin #open=date-time

    Example:

    Date.ToTotalHours(Date.Difference(Date.Parse("2023-11-15"), Date.Parse("2023-11-20"))) / 24

    If you also need to display localized currency units, then this will also be helpful to you #open=internationalization

    ---

    OR You can use Javascript to calculate, Here is an example:

    function calculateDaysDifference(userDate) {

    const startDate = new Date('2023-11-15');

    const endDate = new Date(userDate);

    const diffInTime = endDate.getTime() - startDate.getTime();

    const diffInDays = Math.floor(diffInTime / (1000 * 3600 * 24));

    return diffInDays;

    }

    ---

    Example:

    calculateDaysDifference('2023-11-20')

    Output:

    5

    ---

    But if you are talking about C2, you may need to use Brower to execute JavaScript.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Use @import url(). this works for me.

    CSS
    @import url("https://fonts.googleapis.com/css?family=Amatic+SC:400,700");
    body { font-family: 'Amatic SC', sans-serif; font-size: 2em; }
  • It may be related to your browser Version or computer hardware configuration. You can post your computer hardware information. This can help you find a problem better

    Or you can try to turn off the UI animation and Effect in the settings, which can also reduce the use of memory.

  • Icons in text example: #open=icons-in-text

    Animation Tag [icon=piggy]
    Animation Frame [icon=1] same as [icon=monster]
     
    BBCode Set Size: 
    [size=32][icon=piggy][/size]
    [size=64][icon=piggy][/size]
    
    BBCode Adjusting vertical alignment: 
    [icon=piggy]
    [iconoffsety=0][icon=piggy][/iconoffsety]
    [iconoffsety=50%][icon=piggy][/iconoffsety]
    
  • Tom The Steam deck desktop mode comes with an app store called discover. I found that there are several game engines in it, but Construct is not on the list. In fact, Recently my laptop broke and I have been using steamdeck to run Construct for 2 weeks and everything is fine. I think we can put a version on discover, maybe it can attract some new users.

    apps.kde.org/discover

  • Thanks! it can works.

    This function gets the color value from 0-1, which needs to be converted to 0~255.

    function convertTo255(value) {
     return Math.round(value * 255);
    }
    
    const ALPHAEX_SHIFT = 1024;
    const ALPHAEX_MAX = 1023;
    const RGBEX_SHIFT = 16384;
    const RGBEX_MAX = 8191;
    
    const RGB_MASK = [255, 65280, 16711680];
    const RGB_SHIFT = [0, 8, 16];
    const RGB_FACTOR = [RGBEX_SHIFT * RGBEX_SHIFT * ALPHAEX_SHIFT, RGBEX_SHIFT * ALPHAEX_SHIFT, ALPHAEX_SHIFT]; 
    
    function getColorValue(rgb, index) {
     if (rgb >= 0) {
     return (rgb & RGB_MASK[index]) >> RGB_SHIFT[index];
     } else {
     let v = Math.floor(-rgb % RGB_FACTOR[index] / RGB_FACTOR[index] / ALPHAEX_SHIFT);
     if (v > RGBEX_MAX) v -= RGBEX_SHIFT;
     return v / 1024;
     }
    }
    
    function GetRValue(rgb) {
     return getColorValue(rgb, 0) / 255;
    };
    
    function GetGValue(rgb) {
     return getColorValue(rgb, 1) / 255;
    };
    
    function GetBValue(rgb) {
     return getColorValue(rgb, 2) / 255;
    };
    
    function isNegativeZero(n) {
     return Object.is(n, -0);
    }
    
    function GetAValue(rgb) {
     if (isNegativeZero(rgb))
     return 0;
     else if (rgb >= 0)
     return 1;
     else {
     const v = Math.floor(-rgb % ALPHAEX_SHIFT);
     return v / ALPHAEX_MAX;
     }
    };
    
    function convertTo255(value) {
     return Math.round(value * 255);
    }
    

    Use:

    //------------------------------------------------
    // Set Global Var
    //------------------------------------------------
    const colorValue = runtime.globalVars.colorValue;
    runtime.globalVars.r = convertTo255(C3.GetRValue(colorValue));
    runtime.globalVars.g = convertTo255(C3.GetGValue(colorValue));
    runtime.globalVars.b = convertTo255(C3.GetBValue(colorValue));
    
  • Converting a colorValue back to RGB 255:

    R = int((-colorValue / 2^38) % 1025 * 255 / 1023)

    G = int((-colorValue / 2^24) % 1025 * 255 / 1023)

    B = int((-colorValue / 2^10) % 1025 * 255 / 1023)

    A = int((-colorValue) % 1025 * 255 / 1023)

    I tested using some colors but the formula didn't give the expected results

    -> System: Set colorValue to Sprite.ColorValue

    const colorValue = runtime.globalVars.colorValue;
    runtime.globalVars.r = Math.round((-colorValue / Math.pow(2, 38)) % 1025 * 255 / 1023);
    runtime.globalVars.g = Math.round((-colorValue / Math.pow(2, 24)) % 1025 * 255 / 1023);
    runtime.globalVars.b = Math.round((-colorValue / Math.pow(2, 10)) % 1025 * 255 / 1023);
    runtime.globalVars.a = Math.round((-colorValue) % 1025 * 255 / 1023);
    
    White (255, 255, 255)	// -281492157629439 -> (255,4,196,60)
    Dark(10, 20, 30)		// -10996458578943 -> (10,116,220,36)
    Grey(128, 128, 128)		// -141295868185599 -> (128,122,218,37)
    Red(255, 0, 0)			// -281474976711679 -> (255,4,192,63)
    Green(0, 255, 0)		// -17179870207 -> (0,255,4,251)
    Blue(70, 59, 222)		// -77244652187647 -> (70,216,94,161)
    
  • Ashley I'm confused about the ColorValue expression, which returns an integer that contains negative numbers. Is there a way to convert it to a regular color value?

    For example, Allow expression input parameters:

    ColorValue("R")

    ColorValue("G")

    ColorValue("B")

    ColorValue("A")

XHXIAIEIN's avatar

XHXIAIEIN

Member since 26 Mar, 2016

Twitter
XHXIAIEIN has 9 followers

Trophy Case

  • 8-Year Club
  • Jupiter Mission Supports Gordon's mission to Jupiter
  • Forum Contributor Made 100 posts in the forums
  • Coach One of your tutorials has over 1,000 readers
  • Regular Visitor Visited Construct.net 7 days in a row
  • Steady Visitor Visited Construct.net 30 days in a row
  • Enduring Visitor Visited Construct.net 90 days in a row
  • RTFM Read the fabulous manual
  • x44
    Quick Draw First 5 people to up-vote a new Construct 3 release
  • x10
    Lightning Draw First person to up-vote a new Construct 3 release
  • x9
    Great Comment One of your comments gets 3 upvotes
  • Delicious Comment One of your comments gets 10 upvotes
  • Email Verified

Progress

20/44
How to earn trophies