zatyka's Recent Forum Activity

  • Using a tiled background with a texture made up of a group of 4 squares should accomplish the effect you're looking for. Something like this:

  • You're setting the text to the loop's current X value (The cell's X position, not what it contains). You probably want to replace:

    Append"-"&Array.CurX

    with

    Append"-"&Array.CurValue

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Ah, I see what you mean now. It looks like character widths are only saved per layout. A default character width property sounds like a good idea. In the meantime, you could create a event sheet specifically for setting the the character widths, and include it on the other event sheets.

  • I may be misunderstanding the issue, but you shouldn't have to set the characters widths for each new text within a project. The widths should carry over to each instance of the spritefont. If you're using multiple spritefont objects, and want to set all their character widths, you could add them to a family, and set the character widths of the family.

  • Demo

    Capx

  • You can loop through each letter in the textbox, check if it's a certain letter, and if so, add 1 to a local variable. I'm not at my main PC, so I can't upload a capx, but it would be something like:

    Local varaible "A Count" = 0

    Repeat (len(textbox.text))

        {

        If lowercase(mid(textbox.text,loopindex,1)) = "a"

            {

            add 1 to local variable "A Count"

            }

         }

    If you're still having difficulty, let me know and I'll upload a capx when I get a chance.

  • I imagine it's done with masking and careful Z ordering. Something like this:

    Demo

    Capx

    I hope this helps.

  • As someone who uses keyboard shortcuts as much as possible, I support this suggestion.

  • No. You have 3 possible tokens, but you have to remember that they're zero based when using tokenat. The expression round(random(3)) returns 4 possible values (0,1,2,3..even though it's not completely random... see below). Therefore, the expression tokenat(JSON_,3,"|") looks for a 4th token, which doesn't exist. Using floor(random(3)) ensure only 3 possible values (0,1,2).

    It's not a good idea to use round(random(x)) since it's usually not truly random. Round(Random(3)) is twice as likely to result in a 1 or 2 rather than a 0 or 3. Using floor(random(x)) is usually a better option.

  • The way you have things set up, the array loads some of the time, and other times it tries to load a token that doesn't exist because you're rounding the random value instead of flooring it. Change the expression to:

    tokenat(JSON_,floor(random(0,tokencount(JSON_,"|"))),"|")

  • sosensible

    I replied to your other topic regarding the image editing/saving methods I used. Was there any other aspects of the application you had questions about?

    I'd actually upload the capx for you, but the code is a hot mess since I was trying to finish the app in 48 hours.

  • The method I used to make Paint Share is relatively straight forward.

    Create a 3 dimensional array, with each cell on the X and Y axis representing a pixel. Use the Z axis to save the pixel's color data. In the application's editor, create a "pixel sprite" for each X and Y element, place it appropriately, and set its color. To keep things simple in Paint Share, I limited the palette to only 10 colors, and created a different frame for each color within the pixel sprite. I did this to make sure the game would work on platforms using Canvas2D (IE Mostly). If you're targeting WebGL enabled devices, you could probably get away with a single white sprite, and set it's color using shader effects.

    Anytime the user makes an edit to the image, the appropriate cells and pixel update. To show a preview of an edit (like when drawing a shape/line), the appropriate pixels change color when the mouse button is down, and the appropriate cells are updated when the mouse button is released.

    When you save a drawing locally, the array data is saved to webstorage. When the application is restarted, the array data is retrieved, and the image is redrawn in the application's editor. If a user wants to upload their image to the web for others to see, the canvas size changes to the size of the image, a screenshot is taken, the canvas size goes back to normal, and the png data goes to my server. That way, other users download images as png's rather than an array that renders a sprite per pixel.

    Believe it or not, the hardest part about making the app was creating a flood fill tool.

    Good luck!

zatyka's avatar

zatyka

Member since 11 Aug, 2012

Twitter
zatyka has 1 followers

Trophy Case

  • 12-Year Club
  • Jupiter Mission Supports Gordon's mission to Jupiter
  • x11
    Coach One of your tutorials has over 1,000 readers
  • RTFM Read the fabulous manual

Progress

15/44
How to earn trophies