jsutton's Recent Forum Activity

  • Forgot to add, think I had the moveto max speed set to 5k, same for acc and dec. But that ought to get you in the ballpark.

  • Seems like I've had a bunch of very basic questions lately, just double checking on some basic things.

    * Sprite.A with drag drop behavior (vertical scrolling for a chat area):

    Sprite.B pinned (pin behavior or hierarchy) to sprite.A works perfectly when scolling sprite.A

    The issue is: any of the items that are html(?) based (an iframe, textinput, list, etc.) can't be "pinned" via hierarchy and the pin behavior is very loose (while dragging Sprite.A, the html item can be 0 to 50 pixels off on the y axis. On drop the html item "catches up" and is position to sprite.A gets back to the correct position).

    It's always been this way (for at least 5 years).

    Does anyone know of a way to tighten the pinning of these items so they don't look like they are floating?

  • I was looking for something more along the lines of the "X" when using a textinput as a search box. Doesn't look like that exists. I'll just cheat and make something that looks like what I want and call it good. Thanks!

  • 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?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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?

  • 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.

jsutton's avatar

jsutton

Member since 31 Mar, 2015

Twitter
jsutton has 1 followers

Trophy Case

  • 9-Year Club
  • Forum Contributor Made 100 posts in the forums
  • RTFM Read the fabulous manual
  • Email Verified

Progress

12/44
How to earn trophies