News:

Welcome to the new Sinister Design forums!

Main Menu

Ask the developer a question!

Started by CraigStern, February 07, 2010, 11:01:17 AM

Previous topic - Next topic

CraigStern

Quote from: Duckling on July 26, 2013, 12:38:02 AMBut since the text fields themselves aren't class variables, I can't directly manipulate their contents from the parent object, which has all the relevant information.

Are you using AS3? TextField is absolutely a class; you can manipulate the contents of a TextField using its text property. I usually have a public "update" function in my GUI classes with an array parameter containing all the text to reset my TextFields' text with. (You'll need to setTextFormat after every such update.)

SmartyPants

Quote from: CraigStern on July 25, 2013, 02:15:32 PMFirefox; I really dislike Chrome's UI, which basically makes Firefox the only really viable remaining option.
I find it amusing that you didn't even find IE worth mentioning.

ArtDrake

#1487
Yeah, I'm using AS3, and I get that it's a class. I mean that since in one of my potential solutions, all the TextField objects are generated dynamically, they wouldn't be public variables defined in the class space, and thus would not be directly accessible to a parent object without the help of a workaround.

Anyway, I figured out a way to deal with the whole thing -- I can just shove said TextFields into a public Array, so as to give them a more permanent set of handles.

[EDIT: oops. I guess "dynamically" wasn't quite the word I was looking for, but thanks a lot anyway. My problem was stemming from the way I was defining the fields inside a method of the HUD object -- scope made them a lot less accessible to the parent of the HUD object itself, or the fields' "grandparent", so to speak.]

CraigStern

#1488
Quote from: Duckling on July 26, 2013, 10:25:27 AMin one of my potential solutions, all the TextField objects are generated dynamically, they wouldn't be public variables defined in the class space, and thus would not be directly accessible to a parent object without the help of a workaround

public var newTextField:TextField = new TextField();

Boom! Accessible to the parent. :)

(I do happen to think that a public array is a better solution, though.)

bugfartboy

Although I doubt it, does setting an item's useableWith to "automatic" qualify in the game code as the item being "equipped" to some generic slot?

CraigStern

Nope; automatic just means the item is used immediately upon pickup.

bugfartboy

Is it possible to run actual dialog through a script?

CraigStern


SmartyPants

Is there any particular reason that made you decide to have golems be made of bronze instead of other metals such as iron or steel?

CraigStern

It fit better with the steampunk technology I envisioned them running on.

bugfartboy

Is there an action to remove an item from a character?

CraigStern


bugfartboy

 Seeing as the modding community has started to manifest on the forums, will you be creating a "Modding" subthread?

bugfartboy

Is the proper action to remove a character from a certain coordinate "RemoveFromCoords" or "RemoveCharFromCoords"? In the list it's the former, but in the usage example it's the latter.

CraigStern

Ooh, good catch. It's RemoveFromCoords. I'll fix that in the manual.