Yes, you certainly can. Looking at it now, I see that it really needs to have a barTexture setter, which it is currently lacking. I’ll add that, for the future. In the meantime, you can work around it, by setting the barStyle explicitly, like this:
grid = loader.loadTexture('maps/grid.rgb')
noise = loader.loadTexture('maps/noise.rgb')
wb = DirectWaitBar(frameSize = (0, 1, 0, 1),
scale = (1, 1, 0.1),
pos = (-1, 0, -0.95),
relief = FLAT,
frameColor = (1, 1, 1, 1),
frameTexture = noise,
barRelief = FLAT,
barColor = (1, 1, 1, 1))
wb.barStyle.setTexture(grid)
wb.updateBarStyle()
This will apply two different textures, one to the background frame, and one to the bar which adjusts in the middle. The texture is applied across the bar’s current length, so that as the bar moves across the frame, it will stretch the texture out as it goes. If what you want is to give the effect of the bar revealing the texture, where the texture remains in place and the bar moves through it, you can use Panda’s mechanism to generate texture coordinates based on the vertex positions, as described in the manual, like this:
ts = TextureStage.getDefault()
wb.setTexGen(ts, TexGenAttrib.MWorldPosition)
wb.setTexProjector(ts, render2d, wb);
wb.setTexTransform(ts, TransformState.makeHpr(VBase3(0, 90, 0)))
The first two calls, setTexGen and setTexProjector, are right out of the manual. The last line is also right out of the manual; it rotates the texture mapping 90 degrees so that it maps the X, Z coordinates to the U, V coordinates (since the Y coordinate is not used in render2d).
David