Jump to content

[1.8][SOLVED] ScrollingList - cutting borders.


Ernio

Recommended Posts

Many of you have probably used ScrollingList or some other Gui list like GuiListExtended.

 

The list is designed to show all visible elements, not show what is outside, and what is partially outside - simply cut (overlap) with border.

 

30rll46.jpg

 

(This black thing is border, i just made it transparent, normally below that is re-drawn background image that overlaps part of element under)

 

So now - I was like  "Why not simply cut that shit out?!" - The design described above cant be used in many cases - e/g - what if I want to put my list onto GUI that is rendered NOT from top to bottom (like a container) and my elements are larger than size of list (height) itself?

Not possible using what vanilla/forge gives.

 

Are there tools that would allow to cut out rendered things between some moments in rendering? Basically - to archieve desired effect - would I literally have to go to the very first render and apply border and tell it to not render more than that border - in that case, goodbye FontRenderer and probably everything...

 

Ideas?

 

Other question:

Has anyone ever seen (in mod) a scrolling list put in some container (not on whole screen height) that would not have this problem (elements scrolling out)?

 

EDIT

Ideally i am look for something that would allow me to cut pixels from current rendering, but leaving ones from previous layer.

1.7.10 is no longer supported by forge, you are on your own.

Link to comment
Share on other sites

I shall read about it, but may I ask - how painful is it and why? Any bugs may occur?

 

EDIT (I'll report with results)

Diesieben - bro, u everywhere:

From: http://www.minecraftforge.net/forum/index.php?topic=19948.0

To: https://github.com/diesieben07/SevenCommons/blob/master/src/main/java/de/take_weiland/mods/commons/client/ScrollPane.java#L67

1.7.10 is no longer supported by forge, you are on your own.

Link to comment
Share on other sites

glScissor can be a bitch

I think I just entered brothel...

 

Nothing works as you would expect it to do.

 

drawScreen() method (somewhere)

GL11.glEnable(GL11.GL_SCISSOR_TEST);
if (yElementOffset <= this.bottom && yElementOffset + var13 >= this.top)
{
this.drawSlot(elementIndex, yElementOffset, var13, mouseX, mouseY, tess);
}
GL11.glDisable(GL11.GL_SCISSOR_TEST);

Why the heck when I don't do "GL11.glScissor(x, y, w, h);", but JUST add enable/disable - my gui is cut?

24npmjb.jpg

 

When I add "GL11.glScissor(x, y, w, h);" with all possible values - nothing changes (still cut in same fixed place).

 

And why is it even cut?

 

EDIT

I am trying everything I can find - this shit won't even move, still this stupid border (picture).

 

EDIT 2

I've done SAME thing in totally different GUI. Without even using glScissor (just enabling/disabling) causes GL to cut whole rendered image in EXACLY same place as on screen (relatively - on both guis, I always end up with this cut-line)

1.7.10 is no longer supported by forge, you are on your own.

Link to comment
Share on other sites

width=400 height=212http://img-9gag-lol.9cache.com/photo/ae3D71B_460sa_v1.gif[/img]

 

YEAAAAAH.

 

I am so ducking dumb :D For 2 hours I've been seeking what was the problem, turns out that while I was having fun in Gui class I must have accidentally pasted "GL11.glScissor(0, 0, 1000, 1000);" into my GuiHelper method that handled the rendering used in rendering I was trying to scissor - therefore always setting it to values mentioned. :o

 

How did this happen .___.

1.7.10 is no longer supported by forge, you are on your own.

Link to comment
Share on other sites

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
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.