Package pyjsdl :: Module display :: Class Canvas

Class Canvas

 pyjsobj.Element --+            
                   |            
pyjsobj.FocusElement --+        
                       |        
     pyjsobj.HTML5Canvas --+    
                           |    
             surface.Surface --+
                               |
                              Canvas

Instance Methods
 
__init__(self, size, buffered)
Return Surface subclassed from a Canvas implementation. The size argument is the dimension (w,h) of surface.
 
onMouseMove(self, event)
 
onMouseDown(self, event)
 
onMouseUp(self, event)
 
onMouseEnter(self, sender)
 
onMouseLeave(self, event)
 
onMouseWheel(self, event)
 
onKeyEvent(self, event)
 
onKeyDown(self, event)
 
onKeyUp(self, event)
 
onTouchInitiate(self, event)
 
onTouchStart(self, event)
 
onTouchEnd(self, event)
 
onTouchMove(self, event)
 
onTouchCancel(self, event)
 
preventContextMenu(self, setting=True)
Control contextmenu event. Optional bool setting to prevent event, default to True.
 
resize(self, width, height)
Resize surface.
 
set_callback(self, cb)
 
load_images(self, images)
 
onImagesLoaded(self, images)
 
start(self)
 
stop(self)
 
update(self, timestamp)
 
render(self)

Inherited from surface.Surface: __repr__, __str__, blit, copy, fill, getSubimage, get_at, get_colorkey, get_height, get_offset, get_parent, get_rect, get_size, get_width, replace_color, set_at, set_colorkey, subsurface, toDataURL

Inherited from pyjsobj.HTML5Canvas: arc, beginPath, clear, closePath, drawImage, fillRect, fillText, getContext, getElement, getImageData, lineTo, measureText, moveTo, putImageData, restoreContext, rotate, saveContext, scale, setFillStyle, setFont, setLineWidth, setStrokeStyle, setTextAlign, setTextBaseline, stroke, strokeRect, strokeText, toBlob, transform, translate

Inherited from pyjsobj.FocusElement: addFocusListener, addKeyEventListener, addKeyboardListener, addMouseListener, blur, focus, onBlur, onFocus, onKeyPress, removeKeyEventListener, sinkEvents

Inherited from pyjsobj.Element: addEventListener, appendChild, click, getAttribute, getAttributes, getBoundingClientRect, getClientHeight, getClientLeft, getClientTop, getClientWidth, getID, getMouseWheelEventType, getScrollHeight, getScrollLeft, getScrollTop, getScrollWidth, getStyle, getTitle, removeChild, removeEventListener, setAttribute, setElement, setHeight, setID, setSize, setTitle, setWidth, style

Method Details

__init__(self, size, buffered)
(Constructor)

 

Return Surface subclassed from a Canvas implementation. The size argument is the dimension (w,h) of surface.

Module initialization places pyjsdl.Surface in module's namespace.

Overrides: pyjsobj.Element.__init__

onMouseMove(self, event)

 
Overrides: pyjsobj.FocusElement.onMouseMove

onMouseDown(self, event)

 
Overrides: pyjsobj.FocusElement.onMouseDown

onMouseUp(self, event)

 
Overrides: pyjsobj.FocusElement.onMouseUp

onMouseEnter(self, sender)

 
Overrides: pyjsobj.FocusElement.onMouseEnter

onMouseLeave(self, event)

 
Overrides: pyjsobj.FocusElement.onMouseLeave

onMouseWheel(self, event)

 
Overrides: pyjsobj.FocusElement.onMouseWheel

onKeyDown(self, event)

 
Overrides: pyjsobj.FocusElement.onKeyDown

onKeyUp(self, event)

 
Overrides: pyjsobj.FocusElement.onKeyUp

onTouchInitiate(self, event)

 
Overrides: pyjsobj.FocusElement.onTouchInitiate

onTouchStart(self, event)

 
Overrides: pyjsobj.FocusElement.onTouchStart

onTouchEnd(self, event)

 
Overrides: pyjsobj.FocusElement.onTouchEnd

onTouchMove(self, event)

 
Overrides: pyjsobj.FocusElement.onTouchMove

onTouchCancel(self, event)

 
Overrides: pyjsobj.FocusElement.onTouchCancel

resize(self, width, height)

 
Resize surface.
Overrides: pyjsobj.HTML5Canvas.resize