Newbie Help - DirectGUI

Hi. I am new to Panda3D and need some direction. I’ve read the tutorials and documentation I could find.

What I need to do is build a scrolling text window, where new text appears at the bottom and scrolls “old” text off the top. I’m looking at DirectGUI, but really do not want the buttons displayed by DirectScrollFrame. Are there any resources with code snippets or such that show a nice way of doing this in 2D on a Panda3D app?

I would like to use DirectGUI for this since it allows for parenting, but if it is simpler to use another text rendering solution I’m all ears. Any guidance would be appreciated.

Thanks,

Mike

some snippset ripped out of an old application of mine.
shows how to set up basic directScrolledList. if thats what you are looking for.

from direct.gui.DirectGui import *
import direct.directbase.DirectStart

chatList = DirectScrolledList(
incButton_pos= (-4,0,-2.4),
incButton_scale= (4,1,9),
decButton_pos= (-4,0,-0.8),
decButton_scale= (4,1,9),
frameColor= (0,1,1,1),
scale=0.1,
numItemsVisible = 4)

chatList.reparentTo(aspect2d)

chatList.addItem( "yourNewText", True)
chatList.addItem( "yourNewText2", True)
chatList.addItem( "yourNewText3", True)
chatList.addItem( "yourNewText4", True)
chatList.addItem( "yourNewText5", True)
chatList.addItem( "yourNewText6", True)
run()

if you want custom buttons you can replace them with your model of choice like that:

chatList.incButton['geom'] = loader.loadModel("./textures/gui/chatdown.egg")
chatList.incButton['frameColor']=(1,1,0,0)
chatList.incButton["geom_scale"]=(5,1,2.2)
    
chatList.decButton['geom'] = loader.loadModel("./textures/gui/chatup.egg")
chatList.decButton['frameColor']=(0,0,1,0)
chatList.decButton["geom_scale"]=(5,1,2.2)

hope it helps

Thanks much! That is exactly what I am looking for.