Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha User
    Join Date
    Mar 2011
    Posts
    114
    Vote Rating
    6
    johanhaest is on a distinguished road

      0  

    Default [FIXED-EXTJSIV-328] Dynamically adding Sprites to a Surface

    [FIXED-EXTJSIV-328] Dynamically adding Sprites to a Surface


    For an application I need to dynamically add sprites to a surface.
    I define my class like this:

    Code:
    Ext.define('Test.Control.Event', {
        extend: 'Ext.draw.Sprite',
        type: 'circle',
        x: 150,
        y: 150,
        radius: 100,
        fill: '#cc5',
        stroke: 'red'
    });
    Ext.preg('Test.Control.Event', Test.Control.Event);
    But when I try to add this to the surface it gives an error on line 20937.
    Code:
    custom = me.surface.customAttributes
    
    'surface.customAttributes' is empty or no object
    This is the code where I add my sprite to the surface:
    Code:
    canvas = new Ext.draw.Component({
        viewBox: false
    });
    //create a window to place the draw component in
    Ext.create('Ext.Window', {
        width: 1000,
        height: 500,
        layout: 'fit',
        items: [canvas]
    }).show();
     
    var lEvent = new Test.Control.Event();
    canvas.surface.add(lEvent);
    I there any way to fix this so that I can define sprites and add them to the surface? I'd like to work with them object oriented.
    Or is this already possible and am I doing it wrong?
    Last edited by Jamie Avins; 25 Mar 2011 at 6:47 AM. Reason: Added some code for clarification

  2. #2
    Sencha User
    Join Date
    Nov 2010
    Posts
    168
    Vote Rating
    0
    philogb is on a distinguished road

      0  

    Default


    Hi,

    Thanks for the report. This has been fixed now. The way of creating and drawing the sprite is now:

    HTML Code:
    		var canvas = Ext.create('Ext.draw.Component', {
    			viewBox: false
    		});
    	
    		Ext.define('Test.Control.Event', {
    			extend: 'Ext.draw.Sprite',
    			
    			constructor: function() {
    				this.callParent([{
    					type: 'circle',
    					x: 150,
    					y: 150,
    					radius: 100,
    					fill: '#cc5',
    					stroke: 'red',
    					surface: canvas.surface
    				}]);
    				
    			}
    		});
    	
    	    //create a window to place the draw component in
    	    Ext.create('Ext.Window', {
    		width: 1000,
    		height: 500,
    		layout: 'fit',
    		items: [canvas]
    	    }).show();
    	    
    	    var s = canvas.surface.add(new Test.Control.Event());
    	    
    	    s.show(true);
    Note that the constructor of the subclass has to be extended to pass in the configuration options to the superclass constructor.

Similar Threads

  1. Replies: 1
    Last Post: 25 Mar 2011, 7:02 AM
  2. [FIXED-EXTJSIV-191] Component.js typos
    By LesJ in forum Ext:Bugs
    Replies: 1
    Last Post: 21 Mar 2011, 3:12 PM
  3. [FIXED-442]Dynamically adding tabs to a tabpanel
    By logicmedia in forum Sencha Touch 1.x: Bugs
    Replies: 7
    Last Post: 22 Nov 2010, 8:15 AM
  4. Replies: 3
    Last Post: 8 Sep 2010, 8:14 PM
  5. adding image in tool-sprites
    By bhaskar1605 in forum Ext 2.x: Help & Discussion
    Replies: 5
    Last Post: 14 Oct 2008, 3:56 AM

Thread Participants: 1

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..."