Jump to content

Enable Multi TextLine


Recommended Posts

  • 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 (see edit history)
Link to post
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 post
  • 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

Link to post

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 ?

 

  • Love 1
  • Lmao 1
Link to post

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://i.gyazo.com/0db73ed5d1f0080ddf3b605b75093b86.mp4

 

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: https://mega.nz/file/o8tzXDxB#9FeOGGvcoHRdwP1RrNgloyz-ehLUhuIoo2m2EoZ5fsE

 

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

Edited by Johnny69 (see edit history)
  • Love 1
Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • 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.