mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-05 03:15:07 -04:00
Fixed button press state ordering problem and CardMaker creation bug
This commit is contained in:
parent
dae9071c87
commit
2f57e39d93
@ -50,7 +50,7 @@ class DirectButton(DirectFrame):
|
|||||||
# If specifed, add scaling to the pressed state to make it look
|
# If specifed, add scaling to the pressed state to make it look
|
||||||
# like the button is moving when you press it
|
# like the button is moving when you press it
|
||||||
if self['pressEffect']:
|
if self['pressEffect']:
|
||||||
np = self.stateNodePath[1].attachNewNode('pressEffect')
|
np = self.stateNodePath[1].attachNewNode('pressEffect', 1)
|
||||||
np.setScale(0.98)
|
np.setScale(0.98)
|
||||||
self.stateNodePath[1] = np
|
self.stateNodePath[1] = np
|
||||||
|
|
||||||
|
@ -88,7 +88,8 @@ def printEntryText(text):
|
|||||||
# Here we create an entry, and specify everything up front
|
# Here we create an entry, and specify everything up front
|
||||||
# CALL de1.get() and de1.set('new text') to get and set entry contents
|
# CALL de1.get() and de1.set('new text') to get and set entry contents
|
||||||
de1 = DirectEntry(initialText = 'Hello, how are you?',
|
de1 = DirectEntry(initialText = 'Hello, how are you?',
|
||||||
image = 'phase_3/maps/hotel-room.jpg',
|
image = 'phase_4/maps/middayskyB.jpg',
|
||||||
|
#image = 'phase_3/maps/toowntown-logo.jpg',
|
||||||
image_pos = (4.55, 0, -1.65),
|
image_pos = (4.55, 0, -1.65),
|
||||||
image_scale = (5.5, 1, 2.55),
|
image_scale = (5.5, 1, 2.55),
|
||||||
command = printEntryText,
|
command = printEntryText,
|
||||||
|
@ -46,7 +46,7 @@ class OnscreenImage(PandaObject, NodePath):
|
|||||||
elif type(image) == type(''):
|
elif type(image) == type(''):
|
||||||
# Assume its a file name and create a texture card
|
# Assume its a file name and create a texture card
|
||||||
tex = loader.loadTexture(image)
|
tex = loader.loadTexture(image)
|
||||||
cm = CardMaker()
|
cm = CardMaker('OnscreenImage')
|
||||||
cm.setFrame(-1, 1, -1, 1)
|
cm.setFrame(-1, 1, -1, 1)
|
||||||
self.assign(parent.attachNewNode(cm.generate(), sort))
|
self.assign(parent.attachNewNode(cm.generate(), sort))
|
||||||
self.setTexture(tex)
|
self.setTexture(tex)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user