| popups |
| killPopup
|
popup killWindow.
popup _ nil.
|
| makeBoxButton
|
| mesh cube pic bttn |
mesh _ TGroup new.
cube _ TCube new.
cube extentX: 1.0 y:0.5 z:0.8.
pic _ TTexture
new initializeWithFileName: 'box.png'
mipmap: true
shrinkFit: false.
cube texture: pic.
mesh addChild: cube.
bttn _ TButton new initializeWithFrame: mesh.
bttn persist: true.
bttn spin: true.
^ bttn.
|
| makeCADButton
|
| pic mat bttn |
pic _ TTexture new
initializeWithFileName: 'gridIcon.png'
mipmap: true
shrinkFit: false.
mat _ TMaterial new.
mat ambientColor: TButton overColor.
mat diffuseColor: TButton overColor.
pic material: mat.
pic translationX:0 y:0 z:0.1.
bttn _ TButton new initializeWithFrame: pic.
bttn persist: true.
bttn target: self action: #makeCAD:.
bttn spin: true.
^ bttn.
|
| makeEditBox
|
self killPopup.
|
| makeEditBoxButton
|
| cube pic bttn |
cube _ TCube new.
cube extentX: 1.0 y:1.0 z:0.5.
pic _ TTexture new
initializeWithFileName: 'editBox.png'
mipmap: true
shrinkFit: false.
cube texture: pic.
" bttn _ TSpellBox initializeWithFrame: cube class: TEditBox3D.
bttn target: self action: #makeEditBox.
bttn persist: true.
bttn spin: true."
bttn _ TButton new initializeWithFrame: cube.
bttn persist: true.
bttn spin: true.
^ bttn.
|
| makeExit
|
WorldState addDeferredUIMessage: (MessageSend receiver: Croquet world morph selector: #delete arguments: #()).
self killPopup.
|
| makeExit: ptr
|
WorldState addDeferredUIMessage: (MessageSend receiver: Croquet world morph selector: #delete arguments: #()).
self killPopup.
|
| makeExitButton
|
| pic mat bttn |
pic _ TTexture
new initializeWithFileName: 'exit.png'
mipmap: true
shrinkFit: false.
mat _ TMaterial new.
mat ambientColor: TButton overColor.
mat diffuseColor: TButton overColor.
pic scale: 0.6.
pic material: mat.
pic translationX:0 y:0 z:0.1.
bttn _ TButton new initializeWithFrame: pic.
bttn persist: true.
bttn target: self action: #makeExit:.
bttn spin: true.
^ bttn.
|
| makePopup
|
| tframe |
popup ifNotNil:[
(popup isChild: camLoc) ifTrue:[ self killPopup. popup _ nil. ^self.].
].
tframe _ TButtonHolder new.
tframe addChild: self makeEditBoxButton.
tframe addChild: self makeBoxButton.
tframe addChild: self makeXTerminalButton.
tframe addChild: self makePortalButton.
tframe addChild: self makePortal3DButton.
tframe addChild: self makeWireFilterButton.
tframe addChild: self makeExitButton.
popup _ TWindow new.
popup translationX: 0 y: 0.0 z: -6.0.
popup contents3D: tframe.
popup radius: 0.1.
popup fullBright: true.
camLoc addChild: popup.
popup grabButton: true.
|
| makePortal
|
| p1 win p2 trans ac tp spc |
ac _ Croquet world activeCamera.
spc _ ac root.
tp _ spc teaParty.
ac transparency: 0.0.
trans _ ac globalTransform translation + (ac globalTransform orientation localPointToGlobal: (0@0@-8)).
trans _ ac globalTransform copy translation: trans.
p2 _ (tp global: TSpaceImposter name) new initializeWithSpace: spc transform: trans.
p1 _ (tp global: TPortal name) new.
win _ ac makeWindowInFront.
win contents: p1.
p1 linkPortal: p2.
ac transparency: 1.0.
self killPopup.
|
| makePortal3D
|
| win portal scroller ac tp |
ac _ Croquet world activeCamera.
tp _ ac root teaParty.
portal_ (tp global: TPortal3D name) new initializeWithSpace: ac root.
scroller _ (tp global: TScrollBox3D name) new initializeWithContents: portal.
win _ ac makeWindowInFront.
win contents3D: scroller.
self killPopup.
|
| makePortal3D: ptr
|
| win portal scroller tp root |
root _ ptr avatar root.
tp _ root teaParty.
portal_ (tp global: TPortal3D name) new initializeWithSpace: root.
scroller _ (tp global: TScrollBox3D name) new initializeWithContents: portal.
win _ ptr avatar makeWindowInFront.
win contents3D: scroller.
self killPopup.
|
| makePortal3DButton
|
| mesh winFrame rect pic mat pyramid bttn |
mesh _ TGroup new.
winFrame _ (TWindowFrame new).
winFrame doInside: true.
mesh addChild: winFrame.
mat _ TMaterial new.
mat ambientColor: TButton overColor.
mat diffuseColor: TButton overColor.
pic _ TTexture
new initializeWithFileName: 'box.png'
mipmap: true
shrinkFit: false.
rect _ TRectangle new.
rect texture: pic.
rect material: mat.
rect extent: winFrame extent.
rect translationX: 0 y: -1.0 z:0.
rect rotationAroundX: -90.
mesh addChild: rect.
rect _ TRectangle new.
rect texture: pic.
rect material: mat.
rect extent: winFrame extent.
mesh addChild: rect.
pyramid _ TCylinder new.
pyramid height: 1.
pyramid baseRadius: 0.5.
pyramid topRadius: 0.0.
pyramid translationX: -1.0 y: -1.0 z: 1.0.
pyramid material: mat.
mesh addChild: pyramid.
bttn _ TButton new initializeWithFrame: mesh.
bttn target: self action: #makePortal3D:.
bttn persist: true.
bttn spin: true.
^ bttn.
|
| makePortal: ptr
|
| p1 win p2 trans tp spc ac |
ac _ Croquet world activeCamera.
spc _ ac avatar root.
tp _ spc teaParty.
trans _ ac avatar globalTransform translation + (ac avatar globalTransform orientation localPointToGlobal: (0@0@-8)).
trans _ ac avatar globalTransform copy translation: trans.
p2 _ (tp global: TSpaceImposter name) new initializeWithSpace: spc transform: trans.
p1 _ (tp global: TPortal name) new.
win _ ac avatar makeWindowInFront.
win contents: p1.
p1 linkPortal: p2.
self killPopup.
|
| makePortalButton
|
| mesh winFrame pic mat bttn |
mesh _ TGroup new.
winFrame _ (TWindowFrame new).
mesh addChild: winFrame.
pic _ TTexture
new initializeWithFileName: 'box.png'
mipmap: true
shrinkFit: false.
pic translationX: 0 y: 0 z: 0.25.
mat _ TMaterial new.
mat ambientColor: TButton overColor.
mat diffuseColor: TButton overColor.
pic material: mat.
pic extent: winFrame extent.
winFrame extent: pic extent.
mesh addChild: pic.
bttn _ TButton new initializeWithFrame: mesh.
bttn persist: true.
bttn spin: true.
bttn target: self action: #makePortal:.
^ bttn.
|
| makeWireFilter: ptr
|
| win p |
p _ TWirePortal new.
win _ Croquet world activeCamera makeWindowInFront.
win contents: p.
p linkPortal: win rectBack.
self killPopup.
|
| makeWireFilterButton
|
| mesh winFrame pic mat bttn |
mesh _ TGroup new.
winFrame _ (TWindowFrame new).
mesh addChild: winFrame.
pic _ (TTexture new initializeWithFileName: 'box.png'
mipmap: true
shrinkFit: false) copy.
pic translationX: 0 y: 0 z: 0.25.
mat _ TMaterial new.
mat ambientColor: TButton overColor.
mat diffuseColor: TButton overColor.
pic material: mat.
pic extent: winFrame extent.
winFrame extent: pic extent.
mesh addChild: pic.
bttn _ TButton new initializeWithFrame: mesh.
bttn persist: true.
bttn spin: true.
bttn target: self action: #makeWireFilter:.
^ bttn.
|
| makeX: ptr display: displayName
|
self makeX: ptr display: displayName window: nil.
|
| makeX: ptr display: displayName window: windowName
|
| win htp txwin xlightpipe tp |
"start a monitor using lightpipe in the home tea party of this machine"
htp _ Croquet world homeTeaParty.
tp _ ptr avatar root tp.
xlightpipe _ (htp global: #TXLightPipe) new.
txwin _ (tp global: TXWindow name) new initializeOpaque: true extent: 512@512.
xlightpipe monitorXDisplay: displayName window: windowName eventsTo: txwin.
win _ ptr avatar makeWindowInFront.
win contents:txwin.
|
| makeXDisplay: displayName
|
self makeXDisplay: displayName window: nil.
|
| makeXDisplay: displayName window: windowName
|
| win htp txwin xlightpipe ac tp |
"start a monitor using lightpipe in the home tea party of this machine"
htp _ Croquet world homeTeaParty.
ac _ Croquet world activeCamera.
tp _ ac root tp.
xlightpipe _ (htp global: #TXLightPipe) new.
txwin _ (tp global: TXWindow name) new initializeOpaque: true extent: 512@512.
xlightpipe monitorXDisplay: displayName window: windowName eventsTo: txwin.
win _ ac makeWindowInFront.
win contents:txwin.
|
| makeXTerminal
|
"here we need to make an X terminal that can be opened"
"since this user is the one who must connect it up, we can use a regular Morph
to capture the display id, eventually. For now, just assume a display ID of :1"
self makeXDisplay: ':1'.
self killPopup.
|
| makeXTerminal: ptr
|
"here we need to make an X terminal that can be opened"
"since this user is the one who must connect it up, we can use a regular Morph
to capture the display id, eventually. For now, just assume a display ID of :1"
self makeX: ptr display: ':1'.
self killPopup.
|
| makeXTerminalButton
|
| pic bttn mesh cube |
mesh _ TGroup new.
cube _ TCube new.
cube extentX: 1.0 y:1.0 z:0.5.
pic _ TTexture
new initializeWithFileName: 'xwin.png'
mipmap: true
shrinkFit: false.
cube texture: pic.
mesh addChild: cube.
bttn _ TButton new initializeWithFrame: mesh.
bttn persist: true.
bttn target: self action: #makeXTerminal:.
bttn spin: true.
^ bttn.
|