nettemple's Forum Posts

  • BTW - it only works in the php page as a “GET”… “POST” still is not working. (also - they are on the same domain.)

  • Great reply - understood. But if that is the case, are most games on Construct being developed as “closed-ended”. In other words, are there no easy (visual code) database alternatives for storing and retrieving data for community style game (no MMOs) rather rankings, updating running totals, etc. ty

  • Is this a bug???

    See below: I am trying to make a simple two value post to my SQL database. Below is the code that I have taken from a past tutorial and sample file that was posted. Can someone explain why this is not posting? (It IS actually posting but only as a a GET), but it is designated in the AJAX dialogue as a POST. I would rather the POST work for security :-)

    Tagged:

  • I am an old php programmer and want to know some alternatives to php/mySQL in Construct to record scores, gather, store and display data - basic “dynamic” functions. Something that will extend Construct beyond a closed static experience. I emphasize “easy” because I have to teach high schoolers, so avoid terminal-driven solutions if possible. I see from the comments that php is not popular in this community, but nearly all hosts support php and mySQL and I have had good luck teaching first timers basic GET and POSTs with php and MySQL. Thoughts welcome.

    Tagged:

  • Yes - that works (but trying to style it now) Thank You !

  • My input box does NOT wrap the text with either the placeholder text OR the text as directed in the properties panel?

    Tagged:

  • How do I place the value of a global variable in a text object? I have a variable name "headline" - I want to place the current value of this variable in an <h2> html element object. Any suggestions?

  • Add event (system > compare value)

    Add action to set potion

    Example:

    EVENT variableName (is equal to) true | ACTION SET spritePlayer X=300 Y=300

    If you need a sample I can upload you a c3p file

  • Add event (system > compare value)

    VariableName (is equal to) true

    If you need a simple example, I can post one :-)

  • I know you can access/ use Php and MySQL using the AJAX object... but can you use PHP and access MySQL db by using either the HTML object or the WEB BROWSER object?

    Tagged:

  • The Why: I am having the user click buttons - the action then pastes a text string into the place where the cursor is placed (within the text-input object. Currently the "amend action" always places it at the end.

    The app calls for the user to choose where to paste the string - they do not know what the string is and it is dynamic so therefore it can't be hardcoded. Make sense?

    If there is an easier way, I'm all ears :-)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • No luck, but this is my latest attempt (as stated, I have the text on the clipboard):

    function pasteAtCursor() {
     // Get a reference to the text input object
     const input = runtime.objects.myTextInput.GetInputControl();
    
     // Get the current cursor position
     const startPos = input.selectionStart;
     const endPos = input.selectionEnd;
    
     // Read the text from the clipboard
     navigator.clipboard.readText().then((clipboardText) => {
     // Insert the clipboard text at the current cursor position
     const currentValue = input.value;
     const newValue = currentValue.substring(0, startPos) + clipboardText + currentValue.substring(endPos);
     input.value = newValue;
    
     // Update the cursor position to be immediately after the pasted text
     input.setSelectionRange(startPos + clipboardText.length, startPos + clipboardText.length);
     });
    }
    
  • As a follow-up, currently I am using "amend text" but it always places at the bottom, not where the cursor is positioned.

  • How do I paste text into a text input object at the point of the cursor.?

    I want to paste "Hello World" into a text input sprite at this example location:

    Text input has "This is a test"... I want to paste in "Hello World" here...

    "This is a >paste here | This is the current cursor position< test" - the result would be:

    "This is a Hello World test"

    This is a dynamic modification so I cant simply amend as a simple replacement.

    In other words - the paste-in text could be many different text blocks.

    Thank You - d

    Tagged:

  • I have modified my index.html file to be index.php?name=david

    How can I grab "david" from the url and place in my construct variable vName?

    Please be specific if possible.

    TY in advance - dM

    Tagged: