I think shortening the function names is fine. As for the unique names, I think you can call the Tango strings "string slots" or something similar. After all, they are 'slots' to load strings into, aren't they?

tango.zh
#31
Posted 12 November 2013 - 06:50 PM
#32
Posted 13 November 2013 - 01:47 PM
#33
Posted 27 November 2013 - 08:38 PM
There have been several since alpha 3, however. Lots of things have been renamed, the font format has changed, and extended font characters now start at 256 instead of 127.
The biggest new features this time:
- Characters can be inserted with @## or @(##) now; @26 is a line break, @(76)@(105)@(110)@(107) is "Link"
- A flag for centered text
- A flag to freeze the screen (but you'll have to provide your own implementation)
- New options for loading text; you can append to existing text and load just part of a string
- A function that will calculate custom function names and create constants for you
- Font definitions for all complete Latin fonts
- A lot more input validation and error handling
- Much better documentation
#34
Posted 02 December 2013 - 06:37 PM
I just wanted to say this is great stuff, that I certainly will be using when I start a new project.
Thumbs up!
#35
Posted 20 December 2013 - 03:16 PM
I wish to have the slot position set when needed based off Link's position on screen so he is never covered by the message box. Is this possible?
#36
Posted 20 December 2013 - 06:10 PM
You can use these functions I made:
const int TEXTBOX_HEIGHT = 0; const int TEXTBOX_WIDTH = 0; //Set to the size of your text boxes int MessageCenterScreenX(){ return (SCREEN_WIDTH/2) - (TEXTBOX_WIDTH/2); } int MessageByLinkX(){ return Link->X - TEXTBOX_WIDTH / 2; } int MessageByLinkY(){ //Link in top half, box in bottom half if ( Link->Y <= SCREEN_VISIBLEHEIGHT/2 ){ return Link->Y + 24; } //Link in bottom half, box in top half else return Link->Y - 8 - TEXTBOX_HEIGHT; } int ShowMessageByLink(int message, int style){ return ShowMessage(message, TANGO_SLOT_NORMAL, style, MessageCenterScreenX(), MessageByLinkY()); } int ShowStringByLink(int string, int style){ return ShowString(string, TANGO_SLOT_NORMAL, style, MessageCenterScreenX(), MessageByLinkY()); }
#37
Posted 21 December 2013 - 10:55 PM
Thanks MM, I think I understand how to work with the slots now.
#38
Posted 06 January 2014 - 10:31 AM
How do you we go about making a string a continuation of a previous string. So that the tango strings behave like ZCs?
#39
Posted 09 January 2014 - 03:46 PM
#40
Posted 21 January 2014 - 09:59 AM
I'm planning on writing some custom functions that function the control codes in zstrings. Also would you mine if I use some of your scripts you've provided in the demo?
#41
Posted 21 January 2014 - 10:10 AM
#42
Posted 23 January 2014 - 06:07 AM
Wow, this seems great.
I would like to start to use some of this stuff.
But, may be stupid question... how do I start?
I seem not to be able to download the demo file...
Any suggestion on a very simple "hello world" code to understand how this stuff works?
For instance, how do I write a global script to have a mesage box (center of the screen, black background, Link's Awakening font...) saying "Hello World" when pressing A?
Thanks in advance!
#43
Posted 23 January 2014 - 09:23 AM
#44
Posted 23 January 2014 - 12:00 PM
Huh, not sure what happened to the demo. I re-uploaded it and added an alternate link just in case. It's helpful to look at examples, I think; Tango's a lot easier to use than it is to explain.Wow, this seems great.
I would like to start to use some of this stuff.
But, may be stupid question... how do I start?
I seem not to be able to download the demo file...
Any suggestion on a very simple "hello world" code to understand how this stuff works?
For instance, how do I write a global script to have a mesage box (center of the screen, black background, Link's Awakening font...) saying "Hello World" when pressing A?
Here are the basic directions. I'll add this stuff to the usage file for future versions.
You need three functions in your global script: Tango_Start before the loop, Tango_Update1 before Waitdraw, and Tango_Update2 after Waitdraw.
You need to import at least one font definition and set up at least one style. That looks something like this:
import "tango/font/LA.zh" const int STYLE_PLAIN = 0; void SetUpPlainStyle() { Tango_SetStyleAttribute(STYLE_PLAIN, TANGO_STYLE_BACKDROP_TYPE, TANGO_BACKDROP_COLOR); Tango_SetStyleAttribute(STYLE_PLAIN, TANGO_STYLE_BACKDROP_CSET, 0); Tango_SetStyleAttribute(STYLE_PLAIN, TANGO_STYLE_BACKDROP_COLOR, 15); Tango_SetStyleAttribute(STYLE_PLAIN, TANGO_STYLE_BACKDROP_WIDTH, 160); Tango_SetStyleAttribute(STYLE_PLAIN, TANGO_STYLE_BACKDROP_HEIGHT, 64); Tango_SetStyleAttribute(STYLE_PLAIN, TANGO_STYLE_TEXT_FONT, TANGO_FONT_LA); Tango_SetStyleAttribute(STYLE_PLAIN, TANGO_STYLE_TEXT_CSET, 0); Tango_SetStyleAttribute(STYLE_PLAIN, TANGO_STYLE_TEXT_COLOR, 1); Tango_SetStyleAttribute(STYLE_PLAIN, TANGO_STYLE_TEXT_X, 8); Tango_SetStyleAttribute(STYLE_PLAIN, TANGO_STYLE_TEXT_Y, 8); Tango_SetStyleAttribute(STYLE_PLAIN, TANGO_STYLE_TEXT_WIDTH, 144); Tango_SetStyleAttribute(STYLE_PLAIN, TANGO_STYLE_TEXT_HEIGHT, 48); Tango_SetStyleAttribute(STYLE_PLAIN, TANGO_STYLE_TEXT_SPEED, 5); Tango_SetStyleAttribute(STYLE_PLAIN, TANGO_STYLE_TEXT_SFX, 18); }That's a minimal definition; there are a lot more attributes you can set.
With that set up, displaying a message takes six steps:
1: Find a free text slot (Tango_GetFreeSlot())
2: Clear any data already in the slot (Tango_ClearSlot())
3: Load text into the slot (Tango_LoadString() or Tango_LoadMessage())
4: Set the style (Tango_SetSlotStyle())
5: Set the position (Tango_SetSlotPosition())
6: Activate the text slot (Tango_ActivateSlot())
You can combine all of that into one function easily. The demo has this:
int ShowMessage(int message, int type, int style, float x, float y) { int slot=Tango_GetFreeSlot(type); if(slot==TANGO_INVALID) return TANGO_INVALID; Tango_ClearSlot(slot); Tango_LoadMessage(slot, message); Tango_SetSlotStyle(slot, style); Tango_SetSlotPosition(slot, x, y); Tango_ActivateSlot(slot); return slot; }Some of the concepts (particularly text slot definitions) require further explanation; those should all be covered in the usage file. Let me know if it's not clear enough.
That all sounds like a lot of work, but it's really not. It's mostly one-time stuff, and it's all simple. It just takes a lot of work to explain it all.

Nah, it's actually pretty stable at this point. I only know of one bug right now, and it's pretty minor. I don't expect any changes in subsequent releases to break compatibility.I would really love to use this as well. Maybe, I should wait for a more stable version though. You guys keep giving me the impression that tango.zh could easily break the quest, so.. let me know when the issues are fixed.
- OmegaX likes this
#45
Posted 24 January 2014 - 05:31 AM
Great,
thanks a lot Saffith.
Quick question:
is it currently possible to include an arbitrary combo / tile inside a text frame?
It would be nice to have something like "You found a @combo(99)!", like in the old good GB zelda games...
Can you think at an easy way to implement this kind of functionality?
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users