Jump to content

Label height limited by screen height


BabY

Recommended Posts

Posted

If I use this dummy code for example,

    testLabel = guiCreateLabel(0, 0, 5000, 5000, "1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n42\n43\n44\n45\n46\n47\n48\n49\n50", false)

addCommandHandler("sl", function() -- scroll label
    guiSetProperty(testLabel, "AbsoluteYPosition", guiGetProperty(testLabel, "AbsoluteYPosition") - 20)
end)

addCommandHandler("add", function()
    local text = guiGetText(testLabel)
    text = text .. "\nHello world!"
    guiSetText(testLabel, text)
end)

I cannot add more lines after the line that 'fills' my screen height perfectly. Even if I scroll the label using /sl

 

Any ideas? I tried the properties:

- ClippedByParent

- The Unified family

- VertExtent

- Margin

 

 

It doesn't seem to cause errors when the text is added, because if I move the label down on the Y axis, and scroll it up again the text is still there. Seems like it's a default limitation. I have reasons to use a label instead of a ReadOnly Edit.

Posted

What you could try is creating a rendertarget, drawing the labels in that rendertarget and then drawing the rendertarget on your screen with an offset on the Y axis.

Posted

Draw labels in a render target? Seems like I can't find out how to do it, I only managed to draw dxText which isn't really flexible in my case. :|

Posted
8 hours ago, NeXuS™ said:

Did you try using the guiSetPosition function?

My problem isn't positioning the label, my problem is housing it with more-than-what-my-screen-height-can-house lines. I tried a bunch of methods to move the label around, but this doesn't affect the said limit sadly.

And I need to use a label instead of dxText because I'm dealing with CEGUI, and the main theme of my script is CEGUI because I heavily use GUI functions.

Posted

I tried to avoid this path, but seems like it's the only way then. Thanks for your time and support.

Good luck with dxLib.

Posted (edited)

Thanks, been working on it lately, while I'm highly active on the forum after my break because of an motorcycle accident. GLHF, and just keep motivated, feel free to rage on anything which should work but doesn't. :D

Edited by NeXuS™
Posted (edited)
9 hours ago, said:

Use label inside scrollpane and increase the label height when you add new line

Actually that's EXACTLY what I use. And that's EXACTLY what made me discover this problem lol

Edited by BabY
Typo

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...