Exemplo n.º 1
0
 public GObject()
 {
     name = "";
     absX = -1;
     absY = -1;
     width = -1;
     height = -1;
     objects = new List<GObject>();
     owner = null;
     onClick = null;
     onMouseOver = null;
     textVisible = false;
 }
Exemplo n.º 2
0
 public GObject(String nv,float xv,float yv,int wv,int hv)
 {
     name = nv;
     absX = xv;
     absY = yv;
     width = wv;
     height = hv;
     objects =new  List<GObject>();
     owner = null;
     onClick = null;
     onMouseOver = null;
     textVisible = false;
 }
Exemplo n.º 3
0
        public Texture2D getTexture(Style style,GObject g)
        {
            String alias;

            GButton ob = new GButton();

            //Check for buttons
            if (g.GetType().Equals(ob.GetType()))
            {
                //Determine whether the button is down
                ob = (GButton)g;

                if (ob.IsClicked== true)
                {
                    alias = style.getSkin("BUTTON_DOWN");
                    return (Assets.getInstance().get(alias).Texture);
                }

                alias = style.getSkin("BUTTON_UP");
                return (Assets.getInstance().get(alias).Texture);
            }

            //Check for Frames
            GFrame test = new GFrame();
            if(g.GetType().Equals(test.GetType()))
            {
                test = (GFrame)g;

                alias = test.Background;
                return(Assets.getInstance().get(alias).Texture);
            }

            GImageFrame image = new GImageFrame();
            //Check for image frames
            if(g.GetType().Equals(image.GetType()))
            {
                image=(GImageFrame) g;

                return(Assets.getInstance().get(image.Image).Texture);
            }

            return (null);
        }
        public SWFrameModel(GObject ov, Skinner map, Style style)
        {
            obj = ov;
            box = new Rectangle((int)obj.X, (int)obj.Y, obj.Width, obj.Height);
            models = new List<SWFrameModel>();
            texture = map.getTexture(style, ov);

            //Add Gobjects inside if owns other elements
            if (ov.isOwner() == true)
            {
                List<GObject> p = new List<GObject>();
                p = obj.getAllObjectsOwned(p);

                //Create models for all

                foreach (GObject g in p)
                {
                    models.Add(new SWFrameModel(g, map, style));
                }
            }
        }
Exemplo n.º 5
0
 //The function adds a GObject component
 public void register(GObject obj)
 {
     obj.Owner = this;
     obj.X = this.X + obj.X;
     obj.Y = this.Y + obj.Y;
     objects.Add(obj);
 }
Exemplo n.º 6
0
 public void add(GObject go)
 {
     objects.Add(go);
 }