pastebin - collaborative debugging tool
alicesucks.kpaste.net RSS


ueoa
Posted by Anonymous on Sat 11th Dec 2010 17:04
raw | new post
modification of post by Anonymous (view diff)

  1. # core classes
  2. from edu.cmu.cs.stage3.alice.core import *
  3. from edu.cmu.cs.stage3.alice.core.event import *
  4. from edu.cmu.cs.stage3.alice.core.response import *
  5. from edu.cmu.cs.stage3.alice.core.property import *
  6.  
  7. # constants
  8. from edu.cmu.cs.stage3.alice.core.Direction import *
  9. from edu.cmu.cs.stage3.alice.core.style.TraditionalAnimationStyle import *
  10.  
  11. # misc
  12. from edu.cmu.cs.stage3.alice.authoringtool import *
  13. from edu.cmu.cs.stage3.alice.authoringtool.util import *
  14.  
  15. # image
  16. from java.awt.image import *
  17.  
  18. graphicsConfiguration = AuthoringTool.getHack().getJAliceFrame().getGraphicsConfiguration()
  19.  
  20. def setTexture(object, image):
  21.         texture = TextureMap()
  22.         texture.propertyChanged(PropertyEvent(texture.image, image))
  23.         object.propertyChanged(PropertyEvent(object._diffuseColorMap, texture))
  24.  
  25. def getTextureImage(object):
  26.         '''
  27.         returns java.awt.Image
  28.         '''
  29.         return object.diffuseColorMap.image
  30.  
  31. def onScreen(obj):
  32.         world.bool = camera.canSee(obj, false)
  33.  
  34. def main(screen):
  35.         img = graphicsConfiguration.createCompatibleImage(300, 300)
  36.         screen.setTexture(img)

Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Syntax highlighting:

To highlight particular lines, prefix each line with {%HIGHLIGHT}





All content is user-submitted.
The administrators of this site (kpaste.net) are not responsible for their content.
Abuse reports should be emailed to us at