Ejemplo n.º 1
0
 public virtual void Initialize(List<Option> options, AssetManager assets, string themeName)
 {
     TextDictionary assetDictionary = new TextDictionary(assets.GetText("cursor"));
     this.options = options;
     try { cycleDelay = assetDictionary.LookupInt32(themeName, "cycleDelay"); }
     catch { cycleDelay = 1; }
     try { cycleInterval = assetDictionary.LookupInt32(themeName, "cycleInterval"); }
     catch { cycleInterval = 1; }
     spacing = assetDictionary.LookupSingle(themeName, "spacing");
     if (assetDictionary.CheckPropertyExists(themeName, "cycleSound"))
         cycleSound = new SoundObject(assets.GetSFX(assetDictionary.LookupString(themeName, "cycleSound")));
     if (assetDictionary.CheckPropertyExists(themeName, "selectSound"))
         selectSound = new SoundObject(assets.GetSFX(assetDictionary.LookupString(themeName, "selectSound")));
     selected = false;
 }
Ejemplo n.º 2
0
        public SingularSelector(AssetManager assets, string themeName, Vector2 position, Anchor anchor, Option option)
            : base(themeName, position, 0)
        {
            TextDictionary assetDictionary = new TextDictionary(assets.GetText("selector"));
            string optionTheme = assetDictionary.LookupString(themeName, "optionTheme");
            blinkRate = assetDictionary.LookupInt32(themeName, "blinkRate");
            if (assetDictionary.CheckPropertyExists(themeName, "sound"))
                sound = new SoundObject(assets.GetSFX(assetDictionary.LookupString(themeName, "sound")));
            option.Initialize(assets, optionTheme);

            //this.position *= GraphicsConstants.VIEWPORT_DIMENSIONS / GraphicsConstants.DEFAULT_DIMENSIONS;
            this.Position -= GraphicsHelper.ComputeAnchorOrigin(anchor, option.Dimensions / GraphicsConstants.VIEWPORT_DIMENSIONS);
            this.option = option;
            IntValue = 0;
            timer = 0;
            selected = false;
        }