Giter Club home page Giter Club logo

Comments (3)

bursaar avatar bursaar commented on August 24, 2024

Very nice. Would it be possible to expose the variable system enough to
link up a uGUI text input field?


[email protected]
+353 87 935 0483

On Thu, Oct 30, 2014 at 3:11 PM, chrisgregan [email protected]
wrote:

It should be possible to embed variable values in Say & Choose story text,
like this.
"She glanced through the window and saw {$FriendName} approaching.", where
FriendName is a previously populated string variable.


Reply to this email directly or view it on GitHub
#48.

from fungus.

chrisgregan avatar chrisgregan commented on August 24, 2024

I think you could almost do this now. You could add an event handler to the input field and have it call the SetStringVariable() method on the Fungus Script. Not sure if you could pass the actual value of the input field without a bit of custom c# code though.

Anyway, that's probably how I'd handle it - have a component handle the input field events and then set the variable via the methods in the FungusScript class.

from fungus.

chrisgregan avatar chrisgregan commented on August 24, 2024

Relate request from Daniel Nascimento:
So, giving an option for the player to input it's name and saving it to a string variable, and being able to call that name in dialog.

I made a Choice Dialog prefab with an input text, made the option button call OnClick a script that would set the global variable with the current inputtext.text.text and that solved the first part. Then I went into the parser in the dialog and made a new Glyph.Name so whenever I input {name} on a text I show that string from the global variable instead. Lastly I went into the characters part of the dialog, and added an elseif that if the character name is {name} it'll show the string recorded in the global variables.

That's something that could be somehow implemented already, right? XD

The other thing is Stats, which was pretty easy to implement using the global variables and is kind of specific so wouldn't be really useful to have already implemented in the package. I just made a Text in canvas that keeps updating every 0.5f based on the global variables that we defined for stats.

from fungus.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.