Jump to content

Enable Multi TextLine


Recommended Posts

M2 Download Center

This is the hidden content, please
( Internal )

Before I start it I want to mention that this is an alternative for what @Mali61 posted. You can use either one.

Spoiler

275632How-It-Looks.png

Download link:

This is the hidden content, please

PS: Please read README file

  • Metin2 Dev 78
  • Eyes 2
  • Dislove 1
  • Think 3
  • Good 9
  • Love 1
  • Love 30
Link to comment
Share on other sites

  • Honorable Member

If you place a text below of the textline from its height, where will it shown?

For example you have this text object:

self.text1.SetPosition(30, 36)
self.text1.SetText("This is a\ntext just to\nbe sure it\nworks.")
self.text1.SetLineHeight(20)

And another one like this way:

self.text2.SetPosition(30, self.text1.GetPosition()[1]+5)
self.text2.SetText("This one is good")

 

Edited by xP3NG3Rx
Link to comment
Share on other sites

13 hours ago, xP3NG3Rx said:

If you place a text below of the textline from its height, where will it shown?

For example you have this text object:

self.text1.SetPosition(30, 36) self.text1.SetText("This is a\ntext just to\nbe sure it\nworks.") self.text1.SetLineHeight(20)


self.text1.SetPosition(30, 36)
self.text1.SetText("This is a\ntext just to\nbe sure it\nworks.")
self.text1.SetLineHeight(20)

And another one like this way:

self.text2.SetPosition(30, self.text1.GetPosition()[1]+5) self.text2.SetText("This one is good")


self.text2.SetPosition(30, self.text1.GetPosition()[1]+5)
self.text2.SetText("This one is good")

 

 

I'm guesing you are talking about GetLocalPosition(). That function return rect left and top (left top corner).

The right code it will look like this:

		setYPosition = self.text1.GetLocalPosition()[1]
		setYPosition += self.text1.GetLineHeight() * self.text1.GetTextLineCount()
    
		self.text2.SetPosition(20, setYPosition)

Or you can use GetTextSize() function like this:

		self.text2.SetPosition(20, self.text1.GetLocalPosition()[1] + self.text1.GetTextSize()[1])

 

Link to comment
Share on other sites

  • Honorable Member

Well, I just checked the code, and I've seen the way to it, but anyway thanks.

I think this is a good implementation.

I'm trying to reverse it from the official, but it's ridiculous how they have done this with the arabic codepage.

They have split the render and update functions into two functions like this way

void __thiscall CGraphicTextInstance::Render(void *this, int a2)
{
  void *v2; // esi

  v2 = this;
  if ( GetDefaultCodePage(this) == 1256 )
    CGraphicTextInstance::RenderAR((int)v2, a2);
  else
    CGraphicTextInstance::RenderEU((int)v2, a2);
}

but the normal also has references to the arabic codepage, and vice versa too

2418501857.png

Edited by Metin2 Dev
Core X - External 2 Internal
Link to comment
Share on other sites

Ymir developers are kind of stupid (or at least the ones that work with metin2).

I saw some code from the last months in root and binary and it's bad written, without logic.

If is that wrong in client side imagine how it's like on server side.

 

They only thing I think about those function splited is that they probably wanted to make the functions shorter ?

 

  • Lmao 1
  • Love 1
Link to comment
Share on other sites

As I said in README file, align it wasn't done.

I had a little free time today and I did the align too: (sorry for gif inspiration)

https://metin2.download/picture/naEcD4QuxZVFb2AQM37Odaq5e07Lgds8/.gif

 

If something is wrong with the code please send me a private message or reply in this topic and I will fix it.

 

New link:

This is the hidden content, please

 

PS: Replace the whole code because it has small changes and they are necessarily.

Edited by Metin2 Dev
Core X - External 2 Internal
  • Metin2 Dev 14
  • Good 1
  • Love 1
  • Love 6
Link to comment
Share on other sites

  • 10 months later...
  • 1 year later...

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.