SlideShare una empresa de Scribd logo
1 de 20
Descargar para leer sin conexión
Peint
High-Performance,
 Evented Canvas
Who am I?
 I’m a developer for Blackcomb Games.
I build web & mobile games with HTML5.
Peint is...


• A Javascript graphics engine
• Supports HTML5 Canvas
• Component-based
• Good for any game (isometric, etc)
Philosophy

• Positioning and rendering should be
  handled separately
• High-frequency code should be as
  lightweight as possible
• Rendering should only happen when
  there are changes to render
Features


• Event-based rendering
• Object-based positioning
• Animation management
• Modular design will do CSS3 & WebGL
Event-based rendering
// Ugly nesting needed to ensure image
// is loaded before trying to draw it.
var img = new Image
img.onload = function () {
 function render () {
   requestAnimationFrame(render)

  // This image draws every frame,
  // even though it’s state hasn’t changed.
  context.drawImage(img, 0, 0)
 }
 render()
}
img.src = '/img.png'
Let’s clean that up
// Start canvas
var Game = Peint.all()
var canvas = new Game.Canvas('#viewport')
canvas.start()

// Load image and add to canvas
var img = new Game.Image({ url: '/img.png' })
canvas.add(img)

// Reposition later, redraw automatically
setTimeout(function () {
 img.set({ left: 200, top: 200 })
}, 5000)
Abstract rendering


• Support multiple render methods
• Add objects before loaded
• Change layer sorting
• Automate redraw
Animations
// Create animation
var animation = new Peint.Animation({
 url: '/img.png'
 , top: 330
 , left: 100
 , animation: {
   // Each column is a frame, and each
   // is a separate animation
   rows: 8, cols: 9
   // time between frames is adjustable
   // even while animating
   , duration: 40
 }
})
// play is called at image:loaded, let’s pause
animation.on('image:loaded', function () {
 this.pause()

 // Let’s unpause it later
 setTimeout(function () {
   animation.play()
 }, 1000)
})
Modularity
// Load selectively
var Canvas = Peint.require('canvas')
var Image = Peint.require('image')

// Start canvas
var canvas = new Canvas('#viewport')
canvas.start()

// Load and add image
var image = new Image({ url: '/img.png' })
canvas.add(image)
Advantages


• Easier to support multiple back-ends
• Execution order becomes irrelevant
• Only executes what it needs to
Alternatives

• Easel - monolithic, pollutes global
• Fabric - intended for drawing apps
• Paper - vector transform scripting
• Raphael - SVG, graphs and vector
• Processing - vector visualization
Limitations

• Primitives other than rectangle not
  yet implemented, low priority
• Currently canvas-only, needs at least
  CSS3 to better support mobile
• Alpha-stage, likely to change a lot and
  needs some better optimization
Planned


• Scaling & rotations (Partially done)
• Primitives, lines, etc
• CSS3 & WebGL renderers
• Better examples & tutorials
github.com/qard/peint

Más contenido relacionado

La actualidad más candente

Pokelabo flash 2013/4
Pokelabo flash 2013/4Pokelabo flash 2013/4
Pokelabo flash 2013/4Shota Suzuki
 
飛び道具ではないMetal #iOSDC
飛び道具ではないMetal #iOSDC飛び道具ではないMetal #iOSDC
飛び道具ではないMetal #iOSDCShuichi Tsutsumi
 
Image manipulationworkshop amit
Image manipulationworkshop amitImage manipulationworkshop amit
Image manipulationworkshop amitAmit Singhai
 
BGF 2012 (Browsergames Forum)
BGF 2012 (Browsergames Forum)BGF 2012 (Browsergames Forum)
BGF 2012 (Browsergames Forum)Christof Wegmann
 
Creating 3D Worlds with WebGL and Babylon.js - Codemotion.es
Creating 3D Worlds with WebGL and Babylon.js - Codemotion.esCreating 3D Worlds with WebGL and Babylon.js - Codemotion.es
Creating 3D Worlds with WebGL and Babylon.js - Codemotion.esdavrous
 
Photon Session / Unite12 Conference
Photon Session / Unite12 ConferencePhoton Session / Unite12 Conference
Photon Session / Unite12 ConferenceChristof Wegmann
 
【Unite 2017 Tokyo】Unity UI最適化ガイド 〜ベストプラクティスと新機能
【Unite 2017 Tokyo】Unity UI最適化ガイド 〜ベストプラクティスと新機能【Unite 2017 Tokyo】Unity UI最適化ガイド 〜ベストプラクティスと新機能
【Unite 2017 Tokyo】Unity UI最適化ガイド 〜ベストプラクティスと新機能Unity Technologies Japan K.K.
 
Beginners Guide to Modeling with Maya
Beginners Guide to Modeling with MayaBeginners Guide to Modeling with Maya
Beginners Guide to Modeling with MayaPaddy Lock
 
Sergey Gonchar - Fast rendering with Starling
Sergey Gonchar - Fast rendering with StarlingSergey Gonchar - Fast rendering with Starling
Sergey Gonchar - Fast rendering with StarlingFlash Conference
 
NGF2014 - Create a 3d game with webgl and babylon.js
NGF2014 - Create a 3d game with webgl and babylon.jsNGF2014 - Create a 3d game with webgl and babylon.js
NGF2014 - Create a 3d game with webgl and babylon.jsdavrous
 
OGDC2013_ Spine Animation_ Mr Alviss Ha
OGDC2013_ Spine Animation_ Mr Alviss HaOGDC2013_ Spine Animation_ Mr Alviss Ha
OGDC2013_ Spine Animation_ Mr Alviss Haogdc
 

La actualidad más candente (12)

Pokelabo flash 2013/4
Pokelabo flash 2013/4Pokelabo flash 2013/4
Pokelabo flash 2013/4
 
飛び道具ではないMetal #iOSDC
飛び道具ではないMetal #iOSDC飛び道具ではないMetal #iOSDC
飛び道具ではないMetal #iOSDC
 
Image manipulationworkshop amit
Image manipulationworkshop amitImage manipulationworkshop amit
Image manipulationworkshop amit
 
Photon Load Test #1
Photon Load Test #1Photon Load Test #1
Photon Load Test #1
 
BGF 2012 (Browsergames Forum)
BGF 2012 (Browsergames Forum)BGF 2012 (Browsergames Forum)
BGF 2012 (Browsergames Forum)
 
Creating 3D Worlds with WebGL and Babylon.js - Codemotion.es
Creating 3D Worlds with WebGL and Babylon.js - Codemotion.esCreating 3D Worlds with WebGL and Babylon.js - Codemotion.es
Creating 3D Worlds with WebGL and Babylon.js - Codemotion.es
 
Photon Session / Unite12 Conference
Photon Session / Unite12 ConferencePhoton Session / Unite12 Conference
Photon Session / Unite12 Conference
 
【Unite 2017 Tokyo】Unity UI最適化ガイド 〜ベストプラクティスと新機能
【Unite 2017 Tokyo】Unity UI最適化ガイド 〜ベストプラクティスと新機能【Unite 2017 Tokyo】Unity UI最適化ガイド 〜ベストプラクティスと新機能
【Unite 2017 Tokyo】Unity UI最適化ガイド 〜ベストプラクティスと新機能
 
Beginners Guide to Modeling with Maya
Beginners Guide to Modeling with MayaBeginners Guide to Modeling with Maya
Beginners Guide to Modeling with Maya
 
Sergey Gonchar - Fast rendering with Starling
Sergey Gonchar - Fast rendering with StarlingSergey Gonchar - Fast rendering with Starling
Sergey Gonchar - Fast rendering with Starling
 
NGF2014 - Create a 3d game with webgl and babylon.js
NGF2014 - Create a 3d game with webgl and babylon.jsNGF2014 - Create a 3d game with webgl and babylon.js
NGF2014 - Create a 3d game with webgl and babylon.js
 
OGDC2013_ Spine Animation_ Mr Alviss Ha
OGDC2013_ Spine Animation_ Mr Alviss HaOGDC2013_ Spine Animation_ Mr Alviss Ha
OGDC2013_ Spine Animation_ Mr Alviss Ha
 

Destacado

The library website
The library websiteThe library website
The library websiteBHCLRC
 
LRC News
LRC NewsLRC News
LRC NewsBHCLRC
 
Never travel without a (career) map talent zoo
Never travel without a (career) map   talent zooNever travel without a (career) map   talent zoo
Never travel without a (career) map talent zoovijayaprasad
 
Grouped time-series forecasting: Application to regional infant mortality counts
Grouped time-series forecasting: Application to regional infant mortality countsGrouped time-series forecasting: Application to regional infant mortality counts
Grouped time-series forecasting: Application to regional infant mortality countshanshang
 
Michael Wall - Writing Portfolio
Michael Wall - Writing PortfolioMichael Wall - Writing Portfolio
Michael Wall - Writing PortfolioWall8188
 
Virtual Tour of the Library
Virtual Tour of the LibraryVirtual Tour of the Library
Virtual Tour of the LibraryAmy Chadwell
 
Modeling and forecasting age-specific mortality: Lee-Carter method vs. Functi...
Modeling and forecasting age-specific mortality: Lee-Carter method vs. Functi...Modeling and forecasting age-specific mortality: Lee-Carter method vs. Functi...
Modeling and forecasting age-specific mortality: Lee-Carter method vs. Functi...hanshang
 
Research posters 2015 Update
Research posters 2015 UpdateResearch posters 2015 Update
Research posters 2015 UpdateAmy Chadwell
 
Anti acne-and-tyrosinase-inhibition-properties-of-taxifolin-and-some-flavanon...
Anti acne-and-tyrosinase-inhibition-properties-of-taxifolin-and-some-flavanon...Anti acne-and-tyrosinase-inhibition-properties-of-taxifolin-and-some-flavanon...
Anti acne-and-tyrosinase-inhibition-properties-of-taxifolin-and-some-flavanon...aldila Hairunnisya
 
Visualizing, Modeling and Forecasting of Functional Time Series
Visualizing, Modeling and Forecasting of Functional Time SeriesVisualizing, Modeling and Forecasting of Functional Time Series
Visualizing, Modeling and Forecasting of Functional Time Serieshanshang
 
Using a Library Database - Academic Search Complete
Using a Library Database - Academic Search CompleteUsing a Library Database - Academic Search Complete
Using a Library Database - Academic Search CompleteAmy Chadwell
 
Windows Movie Maker
Windows Movie MakerWindows Movie Maker
Windows Movie MakerAmy Chadwell
 
ใบงานสำรวจตนเอง M6
 ใบงานสำรวจตนเอง M6 ใบงานสำรวจตนเอง M6
ใบงานสำรวจตนเอง M6NuTty Quiz
 
Tes Slide Share
Tes Slide ShareTes Slide Share
Tes Slide Shareputra177
 
ใบงานสำรวจตนเอง M6
 ใบงานสำรวจตนเอง M6 ใบงานสำรวจตนเอง M6
ใบงานสำรวจตนเอง M6NuTty Quiz
 

Destacado (17)

The library website
The library websiteThe library website
The library website
 
LRC News
LRC NewsLRC News
LRC News
 
Never travel without a (career) map talent zoo
Never travel without a (career) map   talent zooNever travel without a (career) map   talent zoo
Never travel without a (career) map talent zoo
 
Grouped time-series forecasting: Application to regional infant mortality counts
Grouped time-series forecasting: Application to regional infant mortality countsGrouped time-series forecasting: Application to regional infant mortality counts
Grouped time-series forecasting: Application to regional infant mortality counts
 
Michael Wall - Writing Portfolio
Michael Wall - Writing PortfolioMichael Wall - Writing Portfolio
Michael Wall - Writing Portfolio
 
Virtual Tour of the Library
Virtual Tour of the LibraryVirtual Tour of the Library
Virtual Tour of the Library
 
Ch7 brand
Ch7 brandCh7 brand
Ch7 brand
 
Modeling and forecasting age-specific mortality: Lee-Carter method vs. Functi...
Modeling and forecasting age-specific mortality: Lee-Carter method vs. Functi...Modeling and forecasting age-specific mortality: Lee-Carter method vs. Functi...
Modeling and forecasting age-specific mortality: Lee-Carter method vs. Functi...
 
Research posters 2015 Update
Research posters 2015 UpdateResearch posters 2015 Update
Research posters 2015 Update
 
Anti acne-and-tyrosinase-inhibition-properties-of-taxifolin-and-some-flavanon...
Anti acne-and-tyrosinase-inhibition-properties-of-taxifolin-and-some-flavanon...Anti acne-and-tyrosinase-inhibition-properties-of-taxifolin-and-some-flavanon...
Anti acne-and-tyrosinase-inhibition-properties-of-taxifolin-and-some-flavanon...
 
IMovie2015
IMovie2015IMovie2015
IMovie2015
 
Visualizing, Modeling and Forecasting of Functional Time Series
Visualizing, Modeling and Forecasting of Functional Time SeriesVisualizing, Modeling and Forecasting of Functional Time Series
Visualizing, Modeling and Forecasting of Functional Time Series
 
Using a Library Database - Academic Search Complete
Using a Library Database - Academic Search CompleteUsing a Library Database - Academic Search Complete
Using a Library Database - Academic Search Complete
 
Windows Movie Maker
Windows Movie MakerWindows Movie Maker
Windows Movie Maker
 
ใบงานสำรวจตนเอง M6
 ใบงานสำรวจตนเอง M6 ใบงานสำรวจตนเอง M6
ใบงานสำรวจตนเอง M6
 
Tes Slide Share
Tes Slide ShareTes Slide Share
Tes Slide Share
 
ใบงานสำรวจตนเอง M6
 ใบงานสำรวจตนเอง M6 ใบงานสำรวจตนเอง M6
ใบงานสำรวจตนเอง M6
 

Similar a Peint talk

Core Animation
Core AnimationCore Animation
Core AnimationBob McCune
 
XNA L07–Skybox and Terrain
XNA L07–Skybox and TerrainXNA L07–Skybox and Terrain
XNA L07–Skybox and TerrainMohammad Shaker
 
Google's HTML5 Work: what's next?
Google's HTML5 Work: what's next?Google's HTML5 Work: what's next?
Google's HTML5 Work: what's next?Patrick Chanezon
 
Core animation taobao
Core animation taobaoCore animation taobao
Core animation taobaoyarshure Kong
 
Lets go vanilla
Lets go vanillaLets go vanilla
Lets go vanillaRan Wahle
 
DotNet 2019 | Marcos Cobeña - Llevando Wave Engine a la web a través de WebGL...
DotNet 2019 | Marcos Cobeña - Llevando Wave Engine a la web a través de WebGL...DotNet 2019 | Marcos Cobeña - Llevando Wave Engine a la web a través de WebGL...
DotNet 2019 | Marcos Cobeña - Llevando Wave Engine a la web a través de WebGL...Plain Concepts
 
Java ME - 05 - Game API
Java ME - 05 - Game APIJava ME - 05 - Game API
Java ME - 05 - Game APIAndreas Jakl
 
WT-4069, WebCL: Enabling OpenCL Acceleration of Web Applications, by Mikael ...
WT-4069, WebCL: Enabling OpenCL Acceleration of Web Applications, by  Mikael ...WT-4069, WebCL: Enabling OpenCL Acceleration of Web Applications, by  Mikael ...
WT-4069, WebCL: Enabling OpenCL Acceleration of Web Applications, by Mikael ...AMD Developer Central
 
Building animated UI with Core Animation
Building animated UI with Core AnimationBuilding animated UI with Core Animation
Building animated UI with Core AnimationMarco Zoffoli
 
Rotoscope inthebrowserppt billy
Rotoscope inthebrowserppt billyRotoscope inthebrowserppt billy
Rotoscope inthebrowserppt billynimbleltd
 
I wanted to change the cloudsrectangles into an actuall image it do.pdf
I wanted to change the cloudsrectangles into an actuall image it do.pdfI wanted to change the cloudsrectangles into an actuall image it do.pdf
I wanted to change the cloudsrectangles into an actuall image it do.pdffeelinggifts
 
Demystifying Angular Animations
Demystifying Angular AnimationsDemystifying Angular Animations
Demystifying Angular AnimationsGil Fink
 
Creating Games for Asha - platform
Creating Games for Asha - platformCreating Games for Asha - platform
Creating Games for Asha - platformJussi Pohjolainen
 
5 tips for your HTML5 games
5 tips for your HTML5 games5 tips for your HTML5 games
5 tips for your HTML5 gamesErnesto Jiménez
 

Similar a Peint talk (20)

Intro to HTML5
Intro to HTML5Intro to HTML5
Intro to HTML5
 
Core Animation
Core AnimationCore Animation
Core Animation
 
XNA L07–Skybox and Terrain
XNA L07–Skybox and TerrainXNA L07–Skybox and Terrain
XNA L07–Skybox and Terrain
 
Google's HTML5 Work: what's next?
Google's HTML5 Work: what's next?Google's HTML5 Work: what's next?
Google's HTML5 Work: what's next?
 
COMP340 TOPIC 4 THREE.JS.pptx
COMP340 TOPIC 4 THREE.JS.pptxCOMP340 TOPIC 4 THREE.JS.pptx
COMP340 TOPIC 4 THREE.JS.pptx
 
Core animation taobao
Core animation taobaoCore animation taobao
Core animation taobao
 
iOS Core Animation
iOS Core AnimationiOS Core Animation
iOS Core Animation
 
Lets go vanilla
Lets go vanillaLets go vanilla
Lets go vanilla
 
DotNet 2019 | Marcos Cobeña - Llevando Wave Engine a la web a través de WebGL...
DotNet 2019 | Marcos Cobeña - Llevando Wave Engine a la web a través de WebGL...DotNet 2019 | Marcos Cobeña - Llevando Wave Engine a la web a través de WebGL...
DotNet 2019 | Marcos Cobeña - Llevando Wave Engine a la web a través de WebGL...
 
Core animation
Core animationCore animation
Core animation
 
Java ME - 05 - Game API
Java ME - 05 - Game APIJava ME - 05 - Game API
Java ME - 05 - Game API
 
HTML 5_Canvas
HTML 5_CanvasHTML 5_Canvas
HTML 5_Canvas
 
WT-4069, WebCL: Enabling OpenCL Acceleration of Web Applications, by Mikael ...
WT-4069, WebCL: Enabling OpenCL Acceleration of Web Applications, by  Mikael ...WT-4069, WebCL: Enabling OpenCL Acceleration of Web Applications, by  Mikael ...
WT-4069, WebCL: Enabling OpenCL Acceleration of Web Applications, by Mikael ...
 
Building animated UI with Core Animation
Building animated UI with Core AnimationBuilding animated UI with Core Animation
Building animated UI with Core Animation
 
Rotoscope inthebrowserppt billy
Rotoscope inthebrowserppt billyRotoscope inthebrowserppt billy
Rotoscope inthebrowserppt billy
 
I wanted to change the cloudsrectangles into an actuall image it do.pdf
I wanted to change the cloudsrectangles into an actuall image it do.pdfI wanted to change the cloudsrectangles into an actuall image it do.pdf
I wanted to change the cloudsrectangles into an actuall image it do.pdf
 
Demystifying Angular Animations
Demystifying Angular AnimationsDemystifying Angular Animations
Demystifying Angular Animations
 
AWS EC2
AWS EC2AWS EC2
AWS EC2
 
Creating Games for Asha - platform
Creating Games for Asha - platformCreating Games for Asha - platform
Creating Games for Asha - platform
 
5 tips for your HTML5 games
5 tips for your HTML5 games5 tips for your HTML5 games
5 tips for your HTML5 games
 

Último

"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DaySri Ambati
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 

Último (20)

"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 

Peint talk

  • 2. Who am I? I’m a developer for Blackcomb Games. I build web & mobile games with HTML5.
  • 3. Peint is... • A Javascript graphics engine • Supports HTML5 Canvas • Component-based • Good for any game (isometric, etc)
  • 4. Philosophy • Positioning and rendering should be handled separately • High-frequency code should be as lightweight as possible • Rendering should only happen when there are changes to render
  • 5. Features • Event-based rendering • Object-based positioning • Animation management • Modular design will do CSS3 & WebGL
  • 7. // Ugly nesting needed to ensure image // is loaded before trying to draw it. var img = new Image img.onload = function () { function render () { requestAnimationFrame(render) // This image draws every frame, // even though it’s state hasn’t changed. context.drawImage(img, 0, 0) } render() } img.src = '/img.png'
  • 9. // Start canvas var Game = Peint.all() var canvas = new Game.Canvas('#viewport') canvas.start() // Load image and add to canvas var img = new Game.Image({ url: '/img.png' }) canvas.add(img) // Reposition later, redraw automatically setTimeout(function () { img.set({ left: 200, top: 200 }) }, 5000)
  • 10. Abstract rendering • Support multiple render methods • Add objects before loaded • Change layer sorting • Automate redraw
  • 12. // Create animation var animation = new Peint.Animation({ url: '/img.png' , top: 330 , left: 100 , animation: { // Each column is a frame, and each // is a separate animation rows: 8, cols: 9 // time between frames is adjustable // even while animating , duration: 40 } })
  • 13. // play is called at image:loaded, let’s pause animation.on('image:loaded', function () { this.pause() // Let’s unpause it later setTimeout(function () { animation.play() }, 1000) })
  • 15. // Load selectively var Canvas = Peint.require('canvas') var Image = Peint.require('image') // Start canvas var canvas = new Canvas('#viewport') canvas.start() // Load and add image var image = new Image({ url: '/img.png' }) canvas.add(image)
  • 16. Advantages • Easier to support multiple back-ends • Execution order becomes irrelevant • Only executes what it needs to
  • 17. Alternatives • Easel - monolithic, pollutes global • Fabric - intended for drawing apps • Paper - vector transform scripting • Raphael - SVG, graphs and vector • Processing - vector visualization
  • 18. Limitations • Primitives other than rectangle not yet implemented, low priority • Currently canvas-only, needs at least CSS3 to better support mobile • Alpha-stage, likely to change a lot and needs some better optimization
  • 19. Planned • Scaling & rotations (Partially done) • Primitives, lines, etc • CSS3 & WebGL renderers • Better examples & tutorials