Guest User

Bait

a guest
Aug 17th, 2010
1,214
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var Bait = new Class({
  2.     Extends : LibCanvas.Interfaces.Drawable,
  3.  
  4.     radius : 15,
  5.     color : '#f0f',
  6.  
  7.     initialize : function () {
  8.         this.bind('libcanvasSet', function (){
  9.             this.shape = new LibCanvas.Shapes.Circle({
  10.                 center : this.createPosition(),
  11.                 radius : this.radius
  12.             });
  13.         });
  14.     },
  15.  
  16.     createPosition : function () {
  17.         return this.libcanvas.ctx
  18.             // получаем элемент LibCanvas.Shapes.Rectangle размерами равный нашему холсту
  19.             .getFullRectangle()
  20.             // Берем из него случайную точку
  21.             .getRandomPoint();
  22.     },
  23.  
  24.     draw : function () {
  25.         this.libcanvas.ctx.fill(this.shape, this.color);
  26.     }
  27. });
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×