// this example should work in AGK V1 and V2
// press the space bar or the on screen button to turn the boxes transparent
// make three boxes, set object color and position them in a line
for i = 1 to 3
CreateObjectBox(i,50,50,50)
// make sure to set the alpha to a value below 255 if you want the object to appear transparent
// the lower the value the more transparent it will appear
SetObjectColor(i,0,255,255,100)
SetObjectPosition(i,0,0,(i-1)*100)
next i
// create a directional light
CreateLightDirectional(1,1,-1,0,255,255,255)
// position and orientate the camera
SetCameraPosition(1,0,100,-300)
SetCameraRotation(1,10,0,0)
// main loop
do
// if the spacebar or on screen button is pressed them make the boxes transparent
if GetButtonState(1) = 0
// turn transparency off
for i = 1 to 3
SetObjectTransparency(i,0)
next i
else
// turn transparency on
for i = 1 to 3
SetObjectTransparency(i,1)
next i
endif
sync()
loop
Help make AGK better by submitting an example for this command! (All examples are subject to approval)