nettemple's Forum Posts

  • 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

  • Try Construct 3

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

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

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

  • Let me clarify - this works ONLY on the sprite rolled over.

    I want it to be dynamic so that I can use one script to rollover ANY sprite and that sprite's name (or UID)is placed into the variable.

    So when:

    --- I rollover Sprite1, "Sprite1" is placed in the variable.

    --- I rollover Sprite2, "Sprite2" is placed in the variable.

    --- I rollover Sprite3, "Sprite3" is placed in the variable.

    The same script for all...

    I hope this is more clear.

    dM

  • I have a variable name varSpriteID.

    When I mouse over any Sprite, I want to set the variable to either the Sprite name OR the UID.

    Here is my crypto logic:

    on MouseOver - set VarSpriteID = CurrentObjectOver.Name

    How can I do this?

    Thank You - d

  • Works - once placed into the variable (then ref the variable) - thank you - nT

  • I have a MAIN SPRITE with 6 animations (1, 2, 3,etc). When I rollover a different "hover" sprite (named "hotspot"), I identify an instance number variable (named "stage" 1, 2, 3,etc) --- I Then create a new instance of my MAIN SPRITE and I want the animation to play based on the matching instance variable.

    For example when I rollover hover sprite and the instance variable is 3, I click to create new object MAIN SPRITE and it should play animation 3. See attached screen shot of attempt.