Ejemplo n.º 1
0
 internal void loadTextures(ContentUtil content, params String[] names)
 {
     foreach (String name in names) {
         if (null == name)
             continue;
         try {
             this.textures[name] = content.load<Texture2D>(name);
         } catch (ContentLoadException e) {
             this.textures[name] = content.load<Texture2D>("missing_texture");
         }
     }
 }
        public DirectionalIndicator(
                ContentUtil content, 
                InputState.Move move,
                float beatTimeInMs,
                float travelSpeed)
        {
            this.recordings = new List<RecordedStart>();
            this.color = Color.White;
            this.move = move;
            this.beatTimeInMs = beatTimeInMs;
            this.travelSpeed = travelSpeed;
            String texName = "hud/arrow_" + move.ToString().ToLower();
            this.texture = new ScaledTexture(
                content.load<Texture2D>(texName), TEXTURE_SCALE);
            switch (move) {
                case InputState.Move.UP:
                    this.direction = new Vector2(0, 1);
                    break;
                case InputState.Move.DOWN:
                    this.direction = new Vector2(0, -1);
                    break;
                case InputState.Move.LEFT:
                    this.direction = new Vector2(1, 0);
                    break;
                case InputState.Move.RIGHT:
                    this.direction = new Vector2(-1, 0);
                    break;
            }

            this.isMoving = false;
        }
Ejemplo n.º 3
0
 public void initialize(ContentUtil content, SceneActivationParameters parameters)
 {
     this.video = content.load<Video>(this.videoName);
     this.player = null;
     this.size = new Rectangle(0, 0, 0, 0);
     this.forceExit = false;
     this.firstUpdate = true;
 }
Ejemplo n.º 4
0
 public SpriteBatchWrapper(SpriteBatch wrapped, GraphicsDevice device, ContentUtil content)
 {
     this.wrapped = wrapped;
     this.wrappedDevice = device;
     this.viewport = device.Viewport.Bounds;
     this.fonts = new Dictionary<string, SpriteFont>();
     this.fonts["default"] = content.load<SpriteFont>("default");
     this.content = content;
 }
Ejemplo n.º 5
0
        public void initialize(ContentUtil content, ContentScript script)
        {
            this.bakground = content.load<Texture2D>(script.get("background"));

            if (script.contains("beatlayers")){
                this.beatSigns = new BeatLayer[script["beatlayers"].Count];
                for (int i = 0; i < this.beatSigns.Length; i++){
                    this.beatSigns[i] = new BeatLayer(content, script["beatlayers"][i]);
                }
            }

            if (script.contains("countlayers")) {
                this.countSigns = new Texture2D[script["countlayers"].Count];
                for (int i = 0; i < this.countSigns.Length; i++) {
                    this.countSigns[i] = content.load<Texture2D>(script["countlayers"][i]);
                }
            }
        }
Ejemplo n.º 6
0
        public void initialize(ContentUtil content, SceneActivationParameters parameters)
        {
            HighscoreParams stageParams = (HighscoreParams) parameters.parameters;
            this.stageName = stageParams.stage;
            this.nextScore = stageParams.newScore;

            this.showInputSound = new Sound("menu/select", content);
            this.createSound = new Sound("menu/click", content);

            this.background = content.load<Texture2D>(null == stageParams.background ?
                "bgr_highscore" : stageParams.background);

            this.lineBackground = new ScaledTexture(content.load<Texture2D>(
                null == stageParams.background ? "hud/highscore_line" : stageParams.background+"_line"),
                .4f);

            this.scores = new HighscoreList();
            this.scores.loadForScene(stageName);
            this.exit = false;

            this.nameInput = new TextInput();

            /*if (null == this.nextScore) {
                this.nextScore = new PlayerProgress();
                this.nextScore.score = 4321;
            }*/
            if (null != this.nextScore) {
                this.nameInput.setMessage("You scored "
                        + this.nextScore.score
                        + ". Please enter your name.");
                this.showInputSound.play();
                this.nameInput.startListening();
            }

            //this.scores.add(new Scoring("Batman", this.nextScore.score, true));
            this.initTime = Environment.TickCount;
        }
Ejemplo n.º 7
0
 private AnimatedTexture loadTexture(ContentUtil content, String name, long time)
 {
     Texture2D tex = content.load<Texture2D>(name);
     AnimatedTexture anim = new AnimatedTexture(tex, time);
     return anim;
 }
Ejemplo n.º 8
0
 public Song(String contentName, ContentUtil content, float bpm)
 {
     this.bpm = bpm;
     this.content = content.load<Microsoft.Xna.Framework.Media.Song>(contentName);
 }
Ejemplo n.º 9
0
            public BeatLayer(ContentUtil content, String loadString)
            {
                String[] cfg = loadString.Split(' ');
                this.texture = content.load<Texture2D>(cfg[0]);
                this.alpha = 0.0f;

                this.updateLengthInBeats = cfg.Length > 1 ? ParserUtil.toFloat(cfg[1]) : 1.0f;
                this.startInMeasure = cfg.Length > 2 ? ParserUtil.toFloat(cfg[2]) : 0.0f;
            }
Ejemplo n.º 10
0
 public Sound(String contentName, ContentUtil content)
 {
     this.sound = content.load<SoundEffect>(contentName);
 }
Ejemplo n.º 11
0
 private ScaledTexture[][] loadButtonTextures(ContentUtil content)
 {
     ScaledTexture[][] textures = new ScaledTexture[4][];
     for (int i = 0; i < textures.Length; i++) {
         textures[i] = new ScaledTexture[2];
         textures[i][0] = new ScaledTexture(
             content.load<Texture2D>("menu/button" + (i + 1) + "_deactivated"),
             .5f);
         textures[i][1] = new ScaledTexture(
             content.load<Texture2D>("menu/button" + (i + 1) + "_activated"),
             .5f);
     }
     return textures;
 }
Ejemplo n.º 12
0
        public void initialize(ContentUtil content, SceneActivationParameters parameters)
        {
            this.input = new ExplicitInputState();
            this.next = false;
            this.exit = false;
            this.firstUpdate = true;
            this.background = content.load<Texture2D>("menu/background01");
            this.clickSound = new Sound("menu/click", content);
            this.selectSound = new Sound("menu/select", content);
            if (null == this.backgroundSong || this.backgroundSong.stoppedPlaying())
                this.backgroundSong = new Song("menu/backgroundsong", content, 120f);

            ScaledTexture[][] buttonTextures = this.loadButtonTextures(content);

            foreach (MenuItem item in this.items) {
                int texIndex = SystemRef.nextRandomInt(0, 4);
                item.initialize(this.clickSound, this.selectSound,
                    buttonTextures[texIndex][0],
                    buttonTextures[texIndex][1]);
            }
            this.items[0].select();
        }
Ejemplo n.º 13
0
 public void initialize(ContentUtil content, SceneActivationParameters parameters)
 {
     this.picture = content.load<Texture2D>(this.pictureName);
     this.fadeAmount = 0.0f;
     this.runningTime = null;
 }