dop2000's Forum Posts

  • Are you using BBcode? It should not consume much cpu. Can you post your project file?

    You can also check these examples:

    https://editor.construct.net/#open=animated-spritefont-effects
    
    https://editor.construct.net/#open=text-formatting
    
    
  • I have no idea what you are asking about. You need to post some pictures or videos or your project file.

  • igortyhon's reply is a bit harsh, but I agree - it makes no sense to use so many functions. It's impossible to understand what's going on in the code.

    Use breakpoints and Debug Preview (Shift+F4) to debug your code. Although breakpoints sometimes don't work in functions.

    Also I suggest using Browser Log action. For example:

    Browser Log "CurrentTestNum=" & CurrentTestNum

  • Arrays in C3 are stored in JSON format. For some reason the editor doesn't recognize that your JSON is an array. Try changing the array size in that popup window, for example increase array depth. Close/re-open the array, maybe it will revert to table form.

  • Nah, maybe someone else will be able to help. I've given two solutions already.

  • Like I said, I can't make sense of your code. Here is my attempt, it's not pretty, but perhaps you will find it useful:

    dropbox.com/scl/fi/u6l027n6mai1oqvikgow9/TextResizing.c3p

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I'm not sure what's going on in your code.

    If you want to change font size with the sprite size, the easiest solution is to add them to a hierarchy. You can do this temporarily, and remove text from hierarchy after resizing.

    Another option is something like this:

    Text set font size to 18*(Spaceship.width/Spaceship.imageWidth)

  • No, it's an old thing, I remember using these expressions in C2.

  • Perhaps the canvas is on a layer with different parallax or scale rate. You can use new expressions LayerToLayerX and LayerToLayerY to convert mouse coordinates to the layer with canvas coordinates.

    You can use expressions Mouse.X(Canvas.layerNumber) and Mouse.Y(Canvas.layerNumber) to get mouse coordinates for the same layer where your canvas is.

  • Why do you need javascript here?

    If the origin point on the canvas is set at top-left, you can simply subtract Canvas coordinate from mouse position. For example to draw a 10px rectangle:

    Canvas Fill Rectangle Left:(Mouse.x-Canvas.x), Top:(Mouse.y-Canvas.y), Right((Mouse.x-Canvas.x+10), Bottom:(Mouse.y-Canvas.y+10)

    Make sure to set fixed canvas resolution mode.

  • There should be Project tab on the right, where you can browse the entire project and access all layouts, event sheets, objects, files etc.

  • I suggest creating a hierarchy with a sprite being parent object, and the text being child object. Then when the parent sprite is resized, the text will be resized as well.

  • Does your recommendation hold if each skill has multiple keys associated with it? Base damage, energy cost, etc.?

    Of course. Each skill is still an object which can contain multiple keys or even nested objects and arrays.

    For example:

    {

    "Skills": { "Punch": {"baseDamage":1, "maxDamage":3, "cost": {"mana": 0, "energy": 5}}, "Kick": {....}

    Arrays in JSON may be useful when you need to store lots of similar values. For example an array of coordinates:

    "PatrolPath": [{"x":1, "y":1}, {"x":2, "y":2}, {"x":4, "y":2}, ....]

    So if I parse Ajax.LastData, it remains parsed?

    Yes, once you load data into a JSON object, it stays there of course. And later you can change it, add new keys, delete keys etc.

  • If your game is grid-based, check out the EasyStarJS addon. It's pathfinding for tilemaps. It has lots of features, you can set different costs for different tiles and it can return the total path cost.

  • Perhaps you are missing "Wait for previous action" after AJAX request in event #3.

    If this doesn't help, enable DevTools when exporting, and then check for any errors in console log in the running app.