.

List of the HTML5 features supported by CocoonJS

This page shows an up to date full list of all the features that the current version of CocoonJS supports.

CanvasRenderingContext

Standard functions
arc
arcTo
beginPath
bezierCurveTo
clearRect
clip
closePath
drawImage
endPath
fill
fillRect
fillText
getImageData
lineTo
measureText
moveTo
putImageData
quadraticCurveTo
rect
restore
rotate
save
scalem
setTransform
stroke
strokeRect
strokeText
transform
translate
createGradient
createPattern
Standard properties
fillStyle
  color strings
  gradients
  patterns
globalAlpha
globalCompositeOperation
lineWidth
strokeStyle
  color strings

canvas

Standard functions
addEventListener
  'mousedown'
  'mousemove'
  'mouseup'
  'mouseout'
  'touchstart'
  'touchend'
  'touchmove'
  'touchcancel'
dispatchEvent
getContext
  1st parameter
    '2d'
  2nd parameter (optional)
    { "antialias" : false }		
    { "antialias" : true }		
removeEventListener
  Same events as in 'addEventListener'
Standard properties
height
width
CocoonJS extended properties

CocoonJS automatically scales your main canvas to fill the whole screen while you still continue working on your application coordinates. There are 3 different ways to specify how the scaling should be done:

idtkScale
  'ScaleToFill' // Default
  'ScaleAspectFit'
  'ScaleAspectFill'

You are able to setup these styles in the cloud compiler. you can also specify them in your code by specifying how the main canvas should be scaled:

canvas.style.cssText="idtkscale:SCALE_TYPE;"; // The SCALE_TYPE can be any of the ones listed above.

audio

Standard functions
addEventListener
  'ended'
  'canplaythrough'
canPlayType
  'audio/mpeg'
  'audio/mp4'
  'audio/x-wav'
load
pause
play
removeEventListener
  Same events as in 'addEventListener'
Standard properties
loop		
volume

websocket

Standard functions
close
send
Standard properties
bufferedAmount
onopen
onclose
onmessage
onerror
readyState

localStorage

Standard functions
clear
getItem
key
removeItem
setItem
Standard properties
length

window

Standard functions
addEventListener
  'load'
  'orientationchange'
  'touchstart'
  'touchend'
  'touchmove'
  'deviceorientation'
  'devicemotion'
alert
clearInterval
clearTimeout
setInterval
setTimeout
removeEventListener
  Same events as in 'addEventListener'
webkitRequestAnimationFrame
Standard properties
innerHeight
innerWidth
onload
ontouchstart
ontouchend
ontouchmove
ondeviceorientation
ondevicemotion

More Information:

W3C Device Orientation and Motion API Specification


document

Standard functions
addEventListener
  'DOMContentLoaded'
appendChild
  canvas and image objects
createElement
  'img'
  'image'
  'audio'
  'canvas'
  'mouseevent'
createEvent
getElementById
  canvas and image objects
removeChild
  canvas and image objects
removeEventListener
  Same events as in 'addEventListener'

Standard properties
userAgent
platform
vendor
appVersion
browser
geolocation
language
vibrate

More information:

W3C Geolocation API Specification

W3C Vibration API Specification

CocoonJS extended properties
isCocoonJS

console

Standard functions
debug
error
info
log
warn

XMLHttpRequest

Standard functions
open
send
Standard properties
onreadystatechange
readyState
responseText
status
statusText
Print/export