Jump to content

Photo

tango.zh


  • Please log in to reply
398 replies to this topic

#361 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 27 December 2017 - 07:58 PM

Suggestion for 1.4.0: The bitmap ID used for text could be defined by the slot. This would allow more slots, by using additional bitmap IDs.

 

Is there a detailed changelog of any kind; or perhaps a GH repo for Tango? (I would almost say that it is worthwhile using GH for all major headers, to more easily track changes.)



#362 Saffith

Saffith

    IPv7 user

  • ZC Developers

Posted 28 December 2017 - 06:23 PM

I'm just using a local svn repo at the moment. I guess I could put it on GitHub, but it's not like I'm doing a whole lot with it lately.

#363 ywkls

ywkls

    Master

  • Members

Posted 07 May 2018 - 01:59 PM

I've been using a function you suggested a while back to give Link an item.

This was how it was set up.

else if(function==FUNC_GIVEITEM)
{

   int it=args[0];
   Link->Item[it]= true;
}

Unfortunately, this didn't regard the in-game counters so you it would look like the counter would overflow even though it wasn't.

I wrote an alternate version, but it seems to have other problems.

else if(function==FUNC_GIVEITEM)
{
     int it=args[0];
     item the_item;
     the_item = Screen->CreateItem(it);
     the_item->X= Link->X;
     the_item->Y= Link->Y;
}

Now it seems to spawn 2 of these items at once and I can still exceed the max counter (despite the fact that the items in question don't affect that). Any suggestions?


Edited by ywkls, 07 May 2018 - 01:59 PM.


#364 Saffith

Saffith

    IPv7 user

  • ZC Developers

Posted 07 May 2018 - 04:06 PM

There's nothing obviously wrong there. There shouldn't be anything special about how that runs that would make it do something unexpected like that.
First of all, could you add a Trace and confirm that it's actually running twice?
The counter thing sounds like a separate issue...

#365 ywkls

ywkls

    Master

  • Members

Posted 08 May 2018 - 01:29 AM

I figured it out. A section of the string being processed by the tango menu was increasing the bomb counter by 8 as well (regardless of whether it was over the max or not). I didn't see it because the string was so long.

 

Thankfully, I had full error logging on where it showed the whole string.



#366 Russ

Russ

    Caelan, the Encouraging

  • Administrators
  • Location:Washington

Posted 25 August 2018 - 09:21 PM

I've run into a problem that is slowly driving me crazy.

I'm trying to work with a custom font. The custom font height is 10. I want two lines to appear in a textbox. So I've got TANGO_STYLE_TEXT_HEIGHT set to 20. However, at this value, the bottom of my text is getting cut off, as seen here. If I increase TANGO_STYLE_TEXT_HEIGHT to 24, the second line will print fine, but Tango will try to draw a third line, resulting in a few cut off pixels at the bottom of the text box. What am I missing here? Shouldn't a value of 20 display both lines perfectly? What do I have to do to get two lines and no more to display at a time?

#367 Saffith

Saffith

    IPv7 user

  • ZC Developers

Posted 25 August 2018 - 10:45 PM

That ought to work, yes. Is the space allocated to it on the bitmap also at least 20 pixels high?

#368 Russ

Russ

    Caelan, the Encouraging

  • Administrators
  • Location:Washington

Posted 25 August 2018 - 10:53 PM

Yes.

Curiously, while poking around a bit more, I found that setting the font height to 14 and TANGO_STYLE_TEXT_HEIGHT to 28 worked. I have no idea why 14-28 would work but not 10-20. If there's some fix, that'd be great, but if not, I think I can make due with this.

#369 Saffith

Saffith

    IPv7 user

  • ZC Developers

Posted 25 August 2018 - 11:12 PM

Huh. Could you show me the relevant bits of script or the quest file? I can't think of much else at the moment, and it's working for me in a quick test.

#370 Russ

Russ

    Caelan, the Encouraging

  • Administrators
  • Location:Washington

Posted 25 August 2018 - 11:33 PM

Sure thing. Here's the style setup:

    Tango_SetStyleAttribute(STYLE_HANDWRITTEN, TANGO_STYLE_BACKDROP_TYPE, TANGO_BACKDROP_TILE);
    Tango_SetStyleAttribute(STYLE_HANDWRITTEN, TANGO_STYLE_BACKDROP_CSET, 7);
    Tango_SetStyleAttribute(STYLE_HANDWRITTEN, TANGO_STYLE_BACKDROP_TILE, 9844);
    Tango_SetStyleAttribute(STYLE_HANDWRITTEN, TANGO_STYLE_BACKDROP_WIDTH, 10);
    Tango_SetStyleAttribute(STYLE_HANDWRITTEN, TANGO_STYLE_BACKDROP_HEIGHT, 2);

    Tango_SetStyleAttribute(STYLE_HANDWRITTEN, TANGO_STYLE_TEXT_FONT, TANGO_FONT_HANDWRITTEN); //TANGO_FONT_HANDWRITTEN
    Tango_SetStyleAttribute(STYLE_HANDWRITTEN, TANGO_STYLE_TEXT_CSET, 7); 
    Tango_SetStyleAttribute(STYLE_HANDWRITTEN, TANGO_STYLE_TEXT_COLOR, 0x04);
    Tango_SetStyleAttribute(STYLE_HANDWRITTEN, TANGO_STYLE_TEXT_X, 8);
    Tango_SetStyleAttribute(STYLE_HANDWRITTEN, TANGO_STYLE_TEXT_Y, 0);
    Tango_SetStyleAttribute(STYLE_HANDWRITTEN, TANGO_STYLE_TEXT_WIDTH, 140);
    Tango_SetStyleAttribute(STYLE_HANDWRITTEN, TANGO_STYLE_TEXT_HEIGHT, 28); //28 works
    Tango_SetStyleAttribute(STYLE_HANDWRITTEN, TANGO_STYLE_TEXT_SPEED, 5);
    Tango_SetStyleAttribute(STYLE_HANDWRITTEN, TANGO_STYLE_TEXT_SFX, 18);
	
	Tango_SetStyleAttribute(STYLE_HANDWRITTEN, TANGO_STYLE_FLAGS, TANGO_FLAG_ENABLE_SPEEDUP | TANGO_FLAG_ENABLE_SUPER_SPEED);
And here's the font:



And here's the font.

#371 Saffith

Saffith

    IPv7 user

  • ZC Developers

Posted 26 August 2018 - 12:20 AM

Okay, got it. Simple issue: the font is taller than that. A font size of ten means every character needs to be within the top 16x10 pixels of its tile. The lowest characters reach all the way to the bottoms of the tiles, so you want a height of 16.

#372 Russ

Russ

    Caelan, the Encouraging

  • Administrators
  • Location:Washington

Posted 26 August 2018 - 01:03 AM

Oh, I figured it would just crop off the top few pixels based on whatever you set the height to (I was planning on doing that manually later, but wanted a working proof of concept first). Why is it that it works with a height of 14 then?

#373 Saffith

Saffith

    IPv7 user

  • ZC Developers

Posted 26 August 2018 - 09:34 AM

Most of the tiles are 14 pixels or less and will look fine that way; it's mainly the lowercase letters that hang below the baseline that go lower. And the full tile still gets drawn, so any on the top line will be okay. If you had a g, j, or y on the second line, it would get cut off.

#374 Russ

Russ

    Caelan, the Encouraging

  • Administrators
  • Location:Washington

Posted 26 August 2018 - 10:33 AM

Oh, it does draw them from the top. For whatever reason, looking at your demo script made me assume it drew letters starting from the bottom. Alright, I can work with that. Thanks.

By the way, I don't think I mentioned, but your custom font sizing example quest is fantastically useful. Thank you very much for creating that. And Tango as a whole, really; I can't even imagine going back to the string editor after using it.

#375 Saffith

Saffith

    IPv7 user

  • ZC Developers

Posted 26 August 2018 - 11:28 AM

Yeah, it's ultimately just plain old Screen->FastTile(). The various size values just tell it how to update the position.
I should probably document the details a bit better. I think it's never been an issue until now only because no one's actually tried to make a custom font before.


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users