jsutton's Forum Posts

  • Is there a way to toggle a textinput set to password from "********" to "password" or is that a build it yourself type of thing? (In the past I've just built my own, but thought perhaps I was missing something? The only issue is that it has to sit outside of the textinput since that is always on top.)

    Example:

  • Hard to tell what you're asking, because it looks like you have it all working well.

    Have you looked at an overlap condition for when the tiles turn blue?

    If the enemy is overlapping do x, if not do y?

  • Have this all working, but not sure how to handle one little aspect.

    Create the spritefont with text: "ghasgkasghdagdsakjhgskahjgdfshgashgdfsahgdfsa" and setting it for word wrap, the text trails off the screen.

    Setting it for character wrap, leaves a dead space on the second line.

    You know of any way to compensate for that?

    There isn't a way to find the x,y of a particular character within a string that I am aware. (If there were, it would be easy to wrap character and then spawn a new spritefont based on that x,y) I guess all I can do is use the word wrap and depend on the user to put things in the proper format?

  • Last dumb one...I'll only be creating the chat text 1 time per cycle (on open chat bar). Each will be static (no changes at all except x,y).

    Performance wise, you think that'll be a big enough deal to warrant going through the effort to have the spritefont.textwidth/height format properly? (I'm setting box size based on the textwidth/height criteria.)

  • I'm just testing all this and appreciate your input. (I'm using you as a sounding board)

    I have a message that, parse into an array, then use the array to create text (we used to call them textareas) and line them up so they wrap, etc and look like a normal textarea should.

    C3 doesn't like creating items outside of about Y=42000.

    1800 textareas works fine.

    Pin is awful 9% cpu usage sitting idle, 19% when scrolling.

    Hierarchy is great 1.6% idle, 7% scrolling.

    The new functions are amazing, 1800 are instantly created. (0.6mb of images, 60fps)

    In the function I just compare the left(text.text,1) and look for #,@, or https,etc (will need multiples for hyperlinks) and bbcode them. Then set a variable to tell me what's what so it's easy to direct the link based on that variable.

    I'm gonna test it either way, but you think I can pick up much performance using a spritefont? I've been using this for 6 years, and have yet to really figure out how to save cpu usage other than by good coding.

    Ran a test using spritefont vs textarea. Identical, 1.6% bouncing to 7% max for either.

  • Been messing with using tokenat and an array for words. Then recombining everything into a pattern that mimics a text area (using your idea). Seems to be pretty good. Using regex to format for and # in the mix (https too).

    Do you happen to know the memory usage of doing this if there are 50k individual text boxes, but 99% are off screen?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I'm attempting to create text that has multiple imbedded links.

    Something similar to (or even exactly like) how a social media site has hashtags, user links (#/@), and/or hyperlinks.

    I'd like to be able to direct each link (determine via my code whether the link opens a new browser tab or opens inside an iframe,etc).

    {Example: Player1 creates a message and sends it to the server. The message contains the name player2 and Player2 and 3 check the server and get their message from player1. Player2 wants to view the game stats for player3, so he clicks on his name inside the message.

    From player1: "Hi @player2 and #player3 are you all interested in someURL.xyz?"}

  • I wouldn't use every tick unless absolutely critical.

    Use 1 sprite for all stop lights. Give each light variables, 1 for the build and 1 for the timer. (This way you could just subtract from the timer variable each second and do something. Timer=30 set green, every sec minus 1, Timer = 10 set yellow, Timer = 8 set red. etc. Or whatever)

    Pick all, then make a sub condition to pick by the build variable.

    (once you use pick by condition, it narrows choices for that group of code and won't check all again unless you reset it with pick all. There's a technical name for it, but I forget what it is.)

    Use 1 timer (or don't and just use the timer variable every second).

    You could have a groups for East/West and NS, or whatever for group type timer changes.

    If you're ever going to use this for something interesting, you might consider incorporating pathfinding and solids, spawning cars at set or random intervals. That way you could run real simulations.

  • Array.At(0,0)&" "&Array.At(1,0)&" "&Array.At(2,0)&" "&Array.At(3,0)&" "&"<a href="&Array.At(4,0)&">"&Array.At(4,0)&"</a>"

    Creates the text properly, then codes the link. Link opens inside the iframe.

    Unfortunately, this isn't what I need.

    I'm trying to embed links after someone posts a message.

    If they type "@whomever", that would be an internal link (not a webpage) and switch to a layout, call a php for that user and then show his profile(easy stuff).

    Unless I've missed something about iframes, they are good for web links and videos.

    Is that wrong? If so, any idea if anyone's done a tutorial on any of this?

  • For what I'm actually doing, I can't figure it out using the iframe.

    I'm actually trying to have linkable "#", "@", and hyperlinks.

    It's doable with dynamic box creation. It's just crazy to have 50k text boxes lol, surely there is an easier way.

  • I'm guessing you mean in the layout editor.

    If so, click on the layout, properties on left, grid size / snap to grid are listed there.

  • Is there any way to create multiple hyperlinks inside a single text?

    The possible solutions I've come up with all seem cumbersome.

    1. Dynamic text, each word having it's own instance allowing each one to have it's own hyperlink.

    2. Pure html where bbcode could handle it.

    3. Allow only 1 hyperlink per text.

    Ideally, something like:

    "If you clicked on this hyperlink it goes to main, but if you click on this hyperlink it goes to a sales page."

    (Funny enough, the editor we are using for this forum has the ability to do exactly what I want, just not sure if that's doable with C3.)

    Tagged:

  • Doubt this is any help, but it looks URLencoded. Is there any way to use URLdecode to get the URL format closer to something usable? Perhaps you could do a regex expression afterwards to get it back into the proper format?

  • The URL works fine.

    Its AJAX or something of the script to give me the ID and that ID put it into de Ajax.Lastdata and then put on the variable UserID

    I just want to double check: "Works fine"

    When you open a browser and on the URL type in your site address and php request with data it returns exactly what you want?

    example:

    yoursite.com/cgi-bin/file.php

    the php file runs and returns the correct id number in html format in your browser. Correct?

    (I use php / ajax everyday. So I'm just walking this through my normal troubleshooting process. Eliminating one problem at a time until complete.)

    If all that works, open your project in debugger mode. Under System, Ajax, lastdata, your id number should be there. If it is not, then check the browser log for an error. If still nothing, check that your ajax request.

    Assuming all that works, you probably just have a simple coding issue, maybe something as simple as Set ID = int(ajax.lastdata) as suggested above.