コード例 #1
0
ファイル: Shape.cs プロジェクト: Otto404/wp-xna
        internal static void Draw( Shape shape, GameTime time, SpriteBatch batch )
        {
            if ( !shape.isVisible )
                return;

            batch.Draw ( shape.Texture, shape.location * World.Scale, null, Color.White, 0, Vector2.Zero, World.TextureScale, SpriteEffects.None, shape.order );
        }
コード例 #2
0
ファイル: CommandScene.cs プロジェクト: Otto404/wp-xna
        internal CommandScene( Vector2 location, GestureType gestureType, string backgroundResourcePath, IList<Resource> resources, IList<Making> makings, bool isBroken )
            : base(location, gestureType,
			ResourceManager.Combine ( new Resource[] {
				new Resource ( "peg", ResourceType.Font, @"font\peg" ),
				new Resource ( "background", ResourceType.Image, string.Format ( @"image\{0}", backgroundResourcePath ) ),
				new Resource ( "click.s", ResourceType.Sound, @"sound\click" ),
			}, resources ),
			combine ( new Making[] {
				new Shape ( "background.s", "background" )
			}, makings ),
			isBroken)
        {
            this.backgroundShape = this.makings["background.s"] as Shape;

            foreach ( Making making in this.makings.Values )
                if ( making is Button )
                {
                    Button button = making as Button;
                    button.Selected += this.buttonSelected;
                    this.buttons.Add ( button );
                }
                else if ( making is Anime )
                    this.animes.Add ( making as Anime );
        }