Inheritance: MonoBehaviour
Esempio n. 1
0
    public static void Ini()
    {
        List  = new Tile [Enum.GetValues(typeof(TileName) ).Length];
        _SpriteManager = GameObject.FindGameObjectWithTag("GameManager").GetComponent<SpriteManager>();

        IniList ();
    }
Esempio n. 2
0
    // Use this for initialization
    public void Start()
    {
        GameObject obj = GameObject.Find("Num_MNG_Smal") ;
        manager = (SpriteManager)obj.GetComponent( typeof(SpriteManager));

        time = new Sprite[Library.getMAXScoreEffectLen()];

        for(int i = 0 ; i < Library.getMAXScoreEffectLen(); i++)
        {
            int wMainus = 1;
            int hMainus = 1;

            time[i] = manager.AddSprite( gameObject,
                WIDTH_NUM - wMainus *2 , HEIGHT_NUM - hMainus * 2 - 1 ,
                wMainus, HEIGHT_NUM - hMainus + 1,
          				WIDTH_NUM - wMainus * 2 ,
                HEIGHT_NUM - hMainus* 2 - 1,
                false );
            time[i].offset.x = -(WIDTH_NUM + WIDTH_NUM / 2 + 10) / 2 * (i + 1) + 20;
            time[i].offset.x *= GameManager.Instance.getScreenW();

            time[i].offset.y = 30 ;
            //time[i].SetSizeXY( time[i].width/2 , time[i].height/2 );
        }

        updateNumbers( showScore );
    }
Esempio n. 3
0
 public void OnEnable()
 {
     if(serializedObject == null)
         return;
     if(sm==null)
         sm = ((GameObject)Resources.Load("Item/Sprite_Manager")).GetComponent<SpriteManager>();
 }
 void Start()
 {
     hero = PantheonPanelManagerSCR.heroGameObject;
     heroInventorySCR = hero.GetComponent<HeroInventory> ();
     spriteManagerSCR = GameObject.FindGameObjectWithTag("SpriteManager").GetComponent<SpriteManager>();
     myIndex = transform.GetSiblingIndex ();
 }
Esempio n. 5
0
    // Use this for initialization
    void Start()
    {
        //firstEffect ( _uvTieX ,  _uvTieY , alphe );

        GameObject obj = GameObject.Find("Flame_MNG") ;
        manager = (SpriteManager)obj.GetComponent( typeof(SpriteManager));

        sprite_data = new Sprite[MAX_FLAME];

        counter = new int[MAX_FLAME];
        counterTime = new float[MAX_FLAME];
        counterChangeTime = new float[MAX_FLAME];
        endFlame = new bool[MAX_FLAME];

        alphe = new float[MAX_FLAME];

        for(int i = 0 ; i < MAX_FLAME; i++)
        {
            sprite_data[i] = manager.AddSprite(
             gameObject,
             WIDTH_NUM ,
             HEIGHT_NUM, 0, HEIGHT_NUM, WIDTH_NUM, HEIGHT_NUM, false );
            setPosisionFlame(i);
        }

        GameManager.Instance.addEffect();
        //SetAlphe(alphe);
    }
Esempio n. 6
0
        public TextureCreator(SpriteManager sprManager, GraphicsDevice device)
        {
            this.sprManager = sprManager;
            this.device = device;

            effect = new BasicEffect(device);
        }
Esempio n. 7
0
 void Update()
 {
     animationManager = GetComponent<SpriteManager>() as SpriteManager;
     if(hitPoints <= 0) {
       animationManager.Play("Die");
       gameObject.GetComponent<BoxCollider>().enabled = false;
       hurtTimer += Time.deltaTime/fallTime;
       //transform.position = Vector3.Lerp(oldPosition, fallPosition, hurtTimer);
     } else if(hurt) {
       hurtTimer += Time.deltaTime;
       if(hurtTimer >= cringeTime && hitPoints > 0) {
     hurt = false;
     hurtTimer = 0;
     fireTimer = 0.7f;
       }
       wasHurt = true;
     } else {
       fireTimer += Time.deltaTime;
       if(fireTimer >= fireTime) {
     fireTime = Random.Range(minFireTime, maxFireTime);
     shooter.Fire();
     fireTimer = 0;
     int lastFrame = animationManager.CurrentAnimation.FrameIndex;
     animationManager.Play("Fire", false);
     animationManager.CurrentAnimation.frameIndex = lastFrame;
       }
       animationManager.Play("Fly",(wasHurt ? true : false));
       wasHurt = false;
       }
 }
Esempio n. 8
0
    void Start()
    {
        spriteManager = GetComponent<SpriteManager>() as SpriteManager;
        spriteManager.AddAnimation("Fire", new int[] {1,2,3,4,0}, 15f, false);
        spriteManager.AddAnimation("Rest", new int[] {0}, 15f, true);

        originalIntensity = light.intensity;
    }
Esempio n. 9
0
 public void LoadContent(Game game, IGameInfo gameInfo)
 {
     GameInfo = gameInfo;
     _gameInfoOverlay = new GameInfoOverlay(game, GameInfo);
     _spriteManager = new SpriteManager(game, GameInfo);
     _spriteManager.LoadContent();
     _background = new Background(game);
 }
Esempio n. 10
0
	// Use this for initialization
	protected virtual void Start () {
		if (spriteManager == null)
        {
            spriteManager = (SpriteManager)Component.FindObjectOfType(typeof(SpriteManager));
        }
		
		DrawAnimation();
	}
Esempio n. 11
0
        public void Load(ContentManager content, SpriteManager manager, SceneInterface scene)
        {
            geoTexture = content.Load<BaseRenderableEffect>("Materials/Dude");

            // First create and submit the empty player container.
            geoSprites = manager.CreateSpriteContainer();
            scene.ObjectManager.Submit(geoSprites);
        }
    // Use this for initialization
    void Start()
    {
        spriteManager = GetComponent<SpriteManager> ();

        spriteManager.AddSprite ( 512f, 512f, new Vector3 ( Screen.width / 2, 220f, 1.1f ), Quaternion.Euler ( 0f, 0f, 0f ), "MainMenu", mainMenu, null, true, false );
        spriteManager.AddSprite ( 100f, 40f, new Vector3 ( Screen.width / 2, 180f, 1f ), Quaternion.Euler ( 0f, 0f, 0f ), "Start", transTex, "MainMenuActions", true, false );
        spriteManager.AddSprite ( 100f, 40f, new Vector3 ( Screen.width / 2, 260f, 1f ), Quaternion.Euler ( 0f, 0f, 0f ), "Help", transTex, "MainMenuActions", true, false );
        spriteManager.AddSprite ( 100f, 40f, new Vector3 ( Screen.width / 2, 340f, 1f ), Quaternion.Euler ( 0f, 0f, 0f ), "About", transTex, "MainMenuActions", true, false );
    }
Esempio n. 13
0
        protected override void Initialize()
        {
            Camera = new Camera ( this );
            HUD = new HUD ( this );
            SpriteBatch = new SpriteBatch ( GraphicsDevice );
            SpriteManager = new SpriteManager ();

            base.Initialize ();
        }
Esempio n. 14
0
 public void clean()
 {
     for( int i=0 ; i<time.Length ; i++ )
     {
         manager.RemoveSprite( time[i] );
         time[i] = null;
     }
     manager = null;
     DestroyObject( gameObject );
 }
Esempio n. 15
0
 public SpriteManagerComponent(GUIController guiController, AGSEditor agsEditor)
     : base(guiController, agsEditor)
 {
     _sprEditor = new SpriteManager();
     _editorPane = new ContentDocument(_sprEditor, "Sprites", this);
     _guiController.RegisterIcon("SpriteManagerIcon", Resources.ResourceManager.GetIcon("iconspr.ico"));
     _guiController.ProjectTree.AddTreeRoot(this, TOP_LEVEL_COMMAND_ID, "Sprites", "SpriteManagerIcon");
     Factory.Events.ShowSpriteManager += new EditorEvents.ShowSpriteManagerHandler(Events_ShowSpriteManager);
     RefreshDataFromGame();
 }
Esempio n. 16
0
    public static void setNumber(SpriteManager man, Sprite spr,int num)
    {
        if( num < 10 ) {
            int x,y;
            x = num;
            y = 0;

            spr.lowerLeftUV = man.PixelCoordToUVCoord(x*WIDTH_NUM, 0);
        }
    }
Esempio n. 17
0
 void AddAnimations()
 {
     spriteManager = sprite.GetComponent<SpriteManager>() as SpriteManager;
     if(spriteManager) {
       for(int i = 0; i < 8; i++) {
     int spriteFrame = i*2;
     spriteManager.AddAnimation("Sparks"+i, new int[] {spriteFrame,spriteFrame+1}, 15f, false);
       }
       PlayAnimation();
     }
 }
Esempio n. 18
0
    public void clean()
    {
        for(int i = 0 ; i < MAX_FLAME; i++)
        {
            manager.RemoveSprite( sprite_data[i] );
            sprite_data[i] = null;
        }

        manager = null;
        DestroyObject( gameObject );
    }
Esempio n. 19
0
 public GamePlayState(Game1 game, GameStateManeger manager, PlayerCharacter Character)
     : base(game, manager)
 {
     SpriteManager = new SpriteManager(game, Character);
     Mapper mapper = new Mapper(SpriteManager, game);
     SpriteManager.player.mapper = mapper;
     Random r = new Random();
     Map m = null;
     mapper.maps.TryGetValue("01", out m);
     mapper.LoadMap(m);
 }
Esempio n. 20
0
    // Use this for initialization
    void Start()
    {
        GameObject refObj = GameObject.Find( "SPM_Filter" );
        Manager = (SpriteManager)refObj.GetComponent( typeof(SpriteManager) );
        Filter = Manager.AddSprite( gameObject, 4,4,0,0,4,4, false );

        Filter.offset = new Vector3(240.0f, -400.0f, 0);
        Filter.SetDrawLayer( 5 );
        Filter.SetSizeXY( 500, 820 );

        Debug.Log("FilterOn");
    }
Esempio n. 21
0
    private Color m_TargetScreenOverlayColor = new Color(25,25,25,25); // default target color: black and fully transparrent

    #endregion Fields

    #region Methods

    public void clean()
    {
        if( Filter != null)
        {
            Manager.RemoveSprite( Filter );
            Filter = null;
            alphe = 0.0f;
            Manager = null;
        }

        DestroyObject( gameObject );
    }
Esempio n. 22
0
		public void SaveScene(string fileName, Camera cameraPosition, SpriteArray spriteArray, bool snapping, float PixelSize, StringArrayArray SpriteArrays, SpriteManager sprMan)
		{
			spriteArrays = SpriteArrays;
			camera = new CameraSave(cameraPosition);
			snappingOn = snapping;
			pixelSize = PixelSize;
			ssa.AddSpriteArray(spriteArray, sprMan);
			FileStream stream= File.Create(fileName);
			BinaryFormatter binFormatter = new BinaryFormatter();
			binFormatter.Serialize(stream, this);
			stream.Close();
		}
Esempio n. 23
0
    protected Vector2[] UVs; // Pointer to the array of UVs in the mesh

    #endregion Fields

    #region Constructors

    public Sprite()
    {
        m_width = 0;
        m_height = 0;
        m_client = null;
        m_manager = null;
        clientTransform = null;
        index = 0;
        drawLayer = 0;
        color = Color.white;

        offset = Vector3.zero;
    }
Esempio n. 24
0
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            // Set mouse visible
            IsMouseVisible = true;

            // set up the sprite manager
            spriteManager = new SpriteManager(this, GraphicsDevice);

            // Add sprite Manager component
            Components.Add(spriteManager);

            // return to base
            base.Initialize();
        }
Esempio n. 25
0
    public void Delete(SpriteManager sm)
    {
        if (_Item.ID != ""){
            string path = Application.persistentDataPath + "/" + _Item.ID;
            FileInfo t = new FileInfo(path);

            if(t.Exists){
                t.Delete();
                sm.Delete(_Item.ID);
            }

            isEditing = false;
        }
    }
Esempio n. 26
0
    public void Start()
    {
        time = new Sprite[Library.getMAXScoreLen()];
        GameObject manegerObj = null;

        if( type == TYPE_SCORE)
        {
            manegerObj = GameObject.Find("Num_MNG") ;
            manegerObj.transform.localPosition =
            new Vector3(0 ,0  , -1);
        }else
        if( type == TYPE_TITLE_SCORE)
        {
            manegerObj = GameObject.Find("Num_MNG") ;
            manegerObj.transform.localPosition =
            new Vector3(0 ,0  , -1);
        }else
        if( type == TYPE_RESULT_SCORE)
        {
            manegerObj = GameObject.Find("Num_MNG_Result") ;
            manegerObj.transform.localPosition =
            new Vector3(0 ,0  , -2);
        }else
        if( type == TYPE_RESULT_DEATH)
        {
            manegerObj = GameObject.Find("Num_MNG_Result") ;
            manegerObj.transform.localPosition =
            new Vector3(0 ,0  , -2);
            //new Vector3(730, 400 , -2);

        }

        manager =(SpriteManager)manegerObj.GetComponent( typeof(SpriteManager));

        for(int i = 0 ; i < Library.getMAXScoreLen(); i++)
        {
            time[i] = manager.AddSprite( gameObject, WIDTH_NUM-2, HEIGHT_NUM, 0, HEIGHT_NUM, WIDTH_NUM-2, HEIGHT_NUM, false );
            time[i].offset.x = -WIDTH_NUM * 1.5f * (i + 1);
            time[i].offset.y = 0 ;
            //if( type == TYPE_RESULT_DEATH)
            //{
            //	time[i].offset.x = -WIDTH_NUM * 1.5f * (i + 1)+1435;
            //	time[i].offset.y = 820 ;
            //}

            time[i].SetSizeXY( time[i].width * 1.5f, time[i].height * 1.5f);
        }

        updateNumbers( 1 );
    }
Esempio n. 27
0
    void Awake()
    {
        if (instance == null)
        {
            instance = this;
            DontDestroyOnLoad(this.gameObject);
        }
        else if (instance != this)
        {
            Destroy(gameObject);
        }

        switch (PlayerPrefs.GetInt("SpriteSelected"))
        {
            case 0: CurrentSprite = Default;
                break;
            case 1: CurrentSprite = Second;
                break;
            case 2: CurrentSprite = Third;
                break;
            case 3: CurrentSprite = Forth;
                break;
            case 4: CurrentSprite = Five;
                break;
            case 5: CurrentSprite = Six;
                break;
            case 6:
                CurrentSprite = Seven;
                break;
            case 7:
                CurrentSprite = Eight;
                break;
            case 8:
                CurrentSprite = Nine;
                break;
            case 9:
                CurrentSprite = Ten;
                break;
            case 10:
                CurrentSprite = Eleven;
                break;
            case 11:
                CurrentSprite = Twelve;
                break;
            case 12:
                CurrentSprite = Thirteen;
                break;
        }
    }
    private void Awake()
    {
        gameManager = GameObject.FindGameObjectWithTag("GameManager");
        gameInfo = gameManager.GetComponent<GameInfo>();
        myInfo = GetComponent<CharacterInfo>();
        spriteManager = GetComponent<SpriteManager>();
        currentHitpoints = maxHitpoints;
        hitShakeTimer = gameObject.AddComponent<Timer>();
        hitShakeTimer.Trigger += ShakeMe;

        originalPosition = transform.position;
        if (maximumDamageReduction < 0)
            maximumDamageReduction = 0;
        if (maximumDamageReduction > 1)
            maximumDamageReduction = 1;
    }
Esempio n. 29
0
 void DrawLayout(SpriteManager sm)
 {
     if(sm.itemName != null){
         for(int i=0;i<sm.itemName.Count;i++){
             EditorGUILayout.LabelField("=========================================");
             EditorGUILayout.BeginHorizontal();
             EditorGUILayout.LabelField ("Name");
             EditorGUILayout.LabelField (sm.itemName[i]);
             EditorGUILayout.EndHorizontal();
             sm.itemIcon[i].sprite = (Sprite)EditorGUILayout.ObjectField ("Icon", sm.itemIcon[i].sprite , typeof(Sprite), true);
             sm.itemDropTexture[i].sprite = (Sprite)EditorGUILayout.ObjectField ("Drop", sm.itemDropTexture[i].sprite, typeof(Sprite), true);
             sm.itemEquipTexture[i].sprite = (Sprite)EditorGUILayout.ObjectField ("Equip", sm.itemEquipTexture[i].sprite, typeof(Sprite), true);
             EditorGUILayout.LabelField("=========================================");
         }
     }
 }
Esempio n. 30
0
    void Start()
    {
        if (instance != null) {
            Destroy (this);
        }
        else {
            instance = this;
        }

        spriteMap = new Dictionary<string,Sprite>();
        Sprite[] spriteArray = Resources.LoadAll<Sprite>("SpriteSheets");

        foreach (Sprite sprite in spriteArray) {
            spriteMap.Add(sprite.name,sprite);
        }
    }
    protected override void OnCreated(Job job)
    {
        if (job.JobTileType == null && job.Type == null)
        {
            // This job doesn't really have an associated sprite with it, so no need to render.
            return;
        }

        if (objectGameObjectMap.ContainsKey(job))
        {
            return;
        }

        GameObject job_go = new GameObject();

        // Add our tile/GO pair to the dictionary.
        objectGameObjectMap.Add(job, job_go);

        job_go.name = "JOB_" + job.Type + "_" + job.tile.X + "_" + job.tile.Y + "_" + job.tile.Z;
        job_go.transform.SetParent(objectParent.transform, true);

        SpriteRenderer sr = job_go.AddComponent <SpriteRenderer>();

        if (job.JobTileType != null)
        {
            // This job is for building a tile.
            // For now, the only tile that could be is the floor, so just show a floor sprite
            // until the graphics system for tiles is fleshed out further.
            job_go.transform.position = job.tile.Vector3;
            sr.sprite = SpriteManager.GetSprite("Tile", "solid");
            sr.color  = new Color32(128, 255, 128, 192);
        }
        else if (job.Description.Contains("deconstruct"))
        {
            sr.sprite = SpriteManager.GetSprite("UI", "CursorCircle");
            sr.color  = Color.red;
            job_go.transform.position = job.tile.Vector3;
        }
        else if (job.Description.Contains("mine"))
        {
            sr.sprite = SpriteManager.GetSprite("UI", "MiningIcon");
            sr.color  = new Color(1, 1, 1, 0.25f);
            job_go.transform.position = job.tile.Vector3;
        }
        else
        {
            // If we get this far we need a buildable prototype, bail if we don't have one
            if (job.buildablePrototype == null)
            {
                return;
            }

            // This is a normal furniture job.
            if (job.buildablePrototype.GetType().ToString() == "Furniture")
            {
                Furniture furnitureToBuild = (Furniture)job.buildablePrototype;
                sr.sprite = fsc.GetSpriteForFurniture(job.Type);
                job_go.transform.position = job.tile.Vector3 + ImageUtils.SpritePivotOffset(sr.sprite, furnitureToBuild.Rotation);
                job_go.transform.Rotate(0, 0, furnitureToBuild.Rotation);
            }
            else if (job.buildablePrototype.GetType().ToString() == "Utility")
            {
                sr.sprite = usc.GetSpriteForUtility(job.Type);
                job_go.transform.position = job.tile.Vector3 + ImageUtils.SpritePivotOffset(sr.sprite);
            }

            sr.color = new Color32(128, 255, 128, 64);
        }

        sr.sortingLayerName = "Jobs";

        // FIXME: This hardcoding is not ideal!  <== Understatement
        if (job.Type == "Door")
        {
            // By default, the door graphic is meant for walls to the east & west
            // Check to see if we actually have a wall north/south, and if so
            // then rotate this GO by 90 degrees
            Tile northTile = world.GetTileAt(job.tile.X, job.tile.Y + 1, job.tile.Z);
            Tile southTile = world.GetTileAt(job.tile.X, job.tile.Y - 1, job.tile.Z);

            if (northTile != null && southTile != null && northTile.Furniture != null && southTile.Furniture != null &&
                northTile.Furniture.HasTypeTag("Wall") && southTile.Furniture.HasTypeTag("Wall"))
            {
                job_go.transform.rotation = Quaternion.Euler(0, 0, 90);
            }
        }

        job.OnJobCompleted += OnRemoved;
        job.OnJobStopped   += OnRemoved;
    }
Esempio n. 32
0
 public void Destroy()
 {
     SpriteManager.RemoveSprite(_sprite);
 }
Esempio n. 33
0
 protected override Sprite GetItemSprite()
 {
     return(SpriteManager.Get(Main.StillSuitType));
 }
Esempio n. 34
0
 void Start()
 {
     Instance = this;
 }
Esempio n. 35
0
        public void Load(SpriteBatch spriteBatch, ContentManager Content, Viewport viewport, bool useCustTexture, Texture2D custTexture)
        {
            SpriteFactory ballBuilder = new SpriteFactory(Content.Load <Texture2D>("PongCircle"), new Vector2(370, 180), spriteBatch).SetUpdateParamaters(new UpdateParamaters(true, true, false));

            ball = ballBuilder.Build();
            Sprite p1 = new SpriteFactory(useCustTexture ? custTexture : Content.Load <Texture2D>("PongSprite1"), new Vector2(0, 160), spriteBatch).SetScale(useCustTexture ? new Vector2(80f / custTexture.Width, 80f / custTexture.Height) : new Vector2(1, 1)).Build();
            Sprite p2 = new Sprite(Content.Load <Texture2D>("PongSprite2"), new Vector2(720, 160), spriteBatch);

            bullet                  = Content.Load <Texture2D>("bullet");
            p2gun                   = new Sprite(Content.Load <Texture2D>("gun"), new Vector2(viewport.Width - 150, 150 + p2.Height - 40), spriteBatch);
            p2gun.Scale            /= 3;
            p2gun.UseCenterAsOrigin = false;
            p1gun                   = new Sprite(Content.Load <Texture2D>("gun"), new Vector2(10, 150 + p1.Height - 40), spriteBatch);
            p1gun.Scale            /= 3;
            p1gun.UseCenterAsOrigin = false;

            p1gun2 = new Sprite(Content.Load <Texture2D>("gun2"), new Vector2(10, 150 + p1.Height - 40), spriteBatch);
            p2gun2 = new Sprite(Content.Load <Texture2D>("gun2"), new Vector2(viewport.Width - 150, 150 + p2.Height - 40), spriteBatch);

            p1gun2.Color = Color.Transparent;
            p2gun2.Color = Color.Transparent;

            p1gun2.UseCenterAsOrigin = false;
            p2gun2.UseCenterAsOrigin = false;

            p1gun3 = new Sprite(Content.Load <Texture2D>("gun3"), new Vector2(10, 150 + p1.Height - 40), spriteBatch);
            p2gun3 = new Sprite(Content.Load <Texture2D>("gun3"), new Vector2(viewport.Width - 150, 150 + p2.Height - 40), spriteBatch);

            p1gun3.Color = Color.Transparent;
            p2gun3.Color = Color.Transparent;

            p1gun3.UseCenterAsOrigin = false;
            p2gun3.UseCenterAsOrigin = false;

            p1gun3.Scale /= 1;
            p2gun3.Scale /= 1;

            p1healthbar   = new Sprite(Content.Load <Texture2D>("full healf"), new Vector2(0), spriteBatch);
            p1healthempty = new Sprite(Content.Load <Texture2D>("healftempty"), new Vector2(0), spriteBatch);

            p2healthbar   = new Sprite(Content.Load <Texture2D>("full healf"), new Vector2(605, 0), spriteBatch);
            p2healthempty = new Sprite(Content.Load <Texture2D>("healftempty"), new Vector2(605, 0), spriteBatch);

            p2healthbar.UseCenterAsOrigin   = false;
            p2healthempty.UseCenterAsOrigin = false;

            p1healthbar.UseCenterAsOrigin   = false;
            p1healthempty.UseCenterAsOrigin = false;

            p1healthbar.Color   = Color.Transparent;
            p1healthempty.Color = Color.Transparent;

            p2healthbar.Color   = Color.Transparent;
            p2healthempty.Color = Color.Transparent;

            p1gun.Color    = Color.Transparent;
            p1gun.Updated += new EventHandler(gun_Updated);
            p2gun.Updated += new EventHandler(gun_Updated);
            p2gun.Color    = Color.Transparent;

            ball.Updated += new EventHandler(ball_Updated);
            p1.Updated   += new EventHandler(p1_Updated);
            p1.Move      += new SpriteMoveEventHandler(p1_Move);
            p2.Updated   += new EventHandler(p2_Updated);
            p2.Move      += new SpriteMoveEventHandler(p2_Move);
            p2gun.Effect  = SpriteEffects.FlipHorizontally;

            gameOver       = new TextSprite(spriteBatch, new Vector2(170, 220), Content.Load <SpriteFont>("SpriteFont1"), "GAME OVER", Color.Black);
            gameOver.Color = Color.Transparent;


            _spriteManager = new SpriteManager(spriteBatch, ball, p1, p2, p2gun, p1gun, p1healthempty, p1healthbar, p2healthempty, p2healthbar, p1gun2, p2gun2, p1gun3, p2gun3);

            _viewport = viewport;

            resetTimer  = new TimeSpan(0, 0, 0, 0, 500);
            elapsedTime = new TimeSpan(0, 0, 0, 0, 0);

            gun  = Content.Load <Song>("Truth of the Legend");
            song = Content.Load <Song>("Cut and Run");

            state = GameState.Play;
        }
Esempio n. 36
0
 public override void Draw(Vector2 location)
 {
     SpriteManager.Draw(DataMap.SpriteId, location, (Vector2)DataMap.Offset, DataMap.Scale, DataMap.Flip);
 }
Esempio n. 37
0
 protected override Atlas.Sprite GetItemSprite()
 {
     return(SpriteManager.Get(TechType.ExosuitTorpedoArmModule));
 }
Esempio n. 38
0
 public void AddToManagers()
 {
     SpriteManager.AddDrawableBatch(this);
     //SpriteManager.AddPositionedObject(mMapBatch);
 }
Esempio n. 39
0
 public void Destroy()
 {
     ShapeManager.Remove(mCrossHair[0]);
     ShapeManager.Remove(mCrossHair[1]);
     SpriteManager.RemovePositionedObject(this);
 }
Esempio n. 40
0
        protected virtual void InitializeSpritesNoFadeIn()
        {
            if (GameBase.Mode == OsuModes.Play)
            {
                spriteSpin = new pSprite(TextureManager.Load(@"spinner-spin"), Fields.TopLeft, Origins.Centre, Clocks.Audio, new Vector2(posTopLeftCentre.X, spinnerTopOffset + 335), SpriteManager.drawOrderFwdLowPrio(StartTime + 6), false, Color.White);
                spriteSpin.Transformations.Add(new Transformation(TransformationType.Fade, 0, 1, StartTime - HitObjectManager.FadeIn / 2, StartTime));
                spriteSpin.Transformations.Add(new Transformation(TransformationType.Fade, 1, 0, EndTime - Math.Min(400, EndTime - StartTime), EndTime));
                SpriteCollection.Add(spriteSpin);

                spriteClear = new pSprite(TextureManager.Load(@"spinner-clear"), Fields.TopLeft, Origins.Centre, Clocks.Audio, new Vector2(posTopLeftCentre.X, spinnerTopOffset + 115), SpriteManager.drawOrderFwdLowPrio(StartTime + 7), false, Color.White);
                spriteClear.Transformations.Add(new Transformation(TransformationType.Fade, 0, 0, StartTime, EndTime));
                SpriteCollection.Add(spriteClear);
            }

            if (newStyleSpinner)
            {
                spriteGlow          = new pSprite(TextureManager.Load(@"spinner-glow"), Fields.TopLeft, Origins.Centre, Clocks.Audio, new Vector2(posTopLeftCentre.X, spinnerTopOffset + 219), SpriteManager.drawOrderFwdLowPrio(StartTime - 1), false, Color.TransparentWhite);
                spriteGlow.Additive = true;
                spriteGlow.Transformations.Add(new Transformation(TransformationType.Fade, 0, 0, StartTime, EndTime));
                SpriteCollection.Add(spriteGlow);

                spriteMiddleTop.Scale = spriteMiddleBottom.Scale = SpriteCircleTop.Scale = spriteCircleBottom.Scale = spriteGlow.Scale = 0.8f;
            }
        }
 protected override Sprite GetItemSprite()
 {
     return(SpriteManager.Get(TechType.PropulsionCannon));
 }
        public void ConvertToSpriteFrameClick(Window callingWindow)
        {
            if (SpriteEditorSettings.EditingSprites &&
                GameData.EditorLogic.CurrentSprites.Count != 0)
            {
                SpriteFrame newSpriteFrame = new SpriteFrame(
                    GameData.EditorLogic.CurrentSprites[0].Texture, SpriteFrame.BorderSides.All);
                SpriteManager.AddSpriteFrame(newSpriteFrame);

                newSpriteFrame.X = GameData.EditorLogic.CurrentSprites[0].X;
                newSpriteFrame.Y = GameData.EditorLogic.CurrentSprites[0].Y;
                newSpriteFrame.Z = GameData.EditorLogic.CurrentSprites[0].Z;

                newSpriteFrame.ScaleX = GameData.EditorLogic.CurrentSprites[0].ScaleX;
                newSpriteFrame.ScaleY = GameData.EditorLogic.CurrentSprites[0].ScaleY;

                newSpriteFrame.RotationX = GameData.EditorLogic.CurrentSprites[0].RotationX;
                newSpriteFrame.RotationY = GameData.EditorLogic.CurrentSprites[0].RotationY;
                newSpriteFrame.RotationZ = GameData.EditorLogic.CurrentSprites[0].RotationZ;

                newSpriteFrame.Alpha = GameData.EditorLogic.CurrentSprites[0].Alpha;

                newSpriteFrame.Red   = GameData.EditorLogic.CurrentSprites[0].Red;
                newSpriteFrame.Green = GameData.EditorLogic.CurrentSprites[0].Green;
                newSpriteFrame.Blue  = GameData.EditorLogic.CurrentSprites[0].Blue;

                newSpriteFrame.Name = GameData.EditorLogic.CurrentSprites[0].Name;

                GameData.DeleteCurrentSprites();

                SpriteEditorSettings.EditingSpriteFrames = true;

                // add code for undoing this.

                GameData.Scene.SpriteFrames.Add(newSpriteFrame);
            }
            else if (SpriteEditorSettings.EditingSpriteFrames &&
                     GameData.EditorLogic.CurrentSpriteFrames.Count != 0)
            {
                /*
                 * Need to set the invisible parent Sprite's texture because it will be used
                 * to set the new EditorSprite's texture.  We could manually do this, but it's
                 * cleaner to just call SetFromRegularSprite and have that handle everything.
                 */

                GameData.EditorLogic.CurrentSpriteFrames[0].CenterSprite.Texture =
                    GameData.EditorLogic.CurrentSpriteFrames[0].Texture;

                EditorSprite es = new EditorSprite();

                es.SetFromRegularSprite(GameData.EditorLogic.CurrentSpriteFrames[0].CenterSprite);
                es.Name   = GameData.EditorLogic.CurrentSpriteFrames[0].Name;
                es.ScaleX = GameData.EditorLogic.CurrentSpriteFrames[0].ScaleX;
                es.ScaleY = GameData.EditorLogic.CurrentSpriteFrames[0].ScaleY;

                GameData.DeleteSpriteFrame(GameData.EditorLogic.CurrentSpriteFrames[0], true);

                SpriteEditorSettings.EditingSprites = true;

                SpriteManager.AddSprite(es);
                GameData.SetStoredAddToSE(es, GameData.EditorProperties.PixelSize);

                //GameData.ihMan.AddInstruction(new seInstructions.CreateSprite(es));

                GuiData.ToolsWindow.paintButton.Unpress();

                GameData.Cursor.ClickSprite(es);
            }
        }
Esempio n. 43
0
 public void AddToManagers(Layer layer)
 {
     SpriteManager.AddToLayer(_sprite, layer);
     Layer = layer;
 }
Esempio n. 44
0
 protected override Sprite GetUnlockSprite()
 {
     return(SpriteManager.Get(SpriteManager.Group.Item, "exosuitdrillarmmodule"));
 }
Esempio n. 45
0
 public void SetType(RedNodeType type)
 {
     if (this.mType != type)
     {
         this.mType = type;
         if (type == RedNodeType.eRedCount)
         {
             this.image.enabled      = true;
             this.image_icon.enabled = false;
             this.text_count.enabled = true;
             this.SetAniEnable(true);
             this.image.set_sprite(SpriteManager.GetUICommon("UICommon_RedNode"));
         }
         else if (type == RedNodeType.eRedEmpty)
         {
             this.image.enabled      = true;
             this.image_icon.enabled = false;
             this.text_count.enabled = false;
             this.SetAniEnable(true);
             this.image.set_sprite(SpriteManager.GetUICommon("UICommon_RedNode"));
         }
         else if (type == RedNodeType.eRedWear)
         {
             this.image.enabled      = true;
             this.image_icon.enabled = true;
             this.text_count.enabled = false;
             this.SetAniEnable(true);
             this.image.set_sprite(SpriteManager.GetUICommon("UICommon_RedNode"));
             this.image_icon.set_sprite(SpriteManager.GetUICommon("UICommon_RedNode_Wear"));
         }
         else if (type == RedNodeType.eRedNew)
         {
             this.image.enabled      = true;
             this.image_icon.enabled = false;
             this.text_count.enabled = true;
             this.SetAniEnable(true);
             this.image.set_sprite(SpriteManager.GetUICommon("UICommon_RedNode"));
             this.text_count.text = GameLogic.Hold.Language.GetLanguageByTID("red_new", Array.Empty <object>());
         }
         else if (type == RedNodeType.eRedUp)
         {
             this.image.enabled      = true;
             this.image_icon.enabled = true;
             this.text_count.enabled = false;
             this.SetAniEnable(true);
             this.image.set_sprite(SpriteManager.GetUICommon("UICommon_RedNode"));
             this.image_icon.set_sprite(SpriteManager.GetUICommon("UICommon_RedNode_Up"));
         }
         else if (type != RedNodeType.eGreenCount)
         {
             if (type == RedNodeType.eGreenEmpty)
             {
                 this.image.enabled      = true;
                 this.image_icon.enabled = false;
                 this.text_count.enabled = false;
                 this.SetAniEnable(false);
                 this.image.set_sprite(SpriteManager.GetUICommon("UICommon_GreenNode"));
             }
             else if (type == RedNodeType.eGreenUp)
             {
                 this.image.enabled      = true;
                 this.image_icon.enabled = true;
                 this.text_count.enabled = false;
                 this.SetAniEnable(false);
                 this.image.set_sprite(SpriteManager.GetUICommon("UICommon_GreenNode"));
                 this.image_icon.set_sprite(SpriteManager.GetUICommon("UICommon_RedNode_Up"));
             }
             else if (type == RedNodeType.eWarning)
             {
                 this.image.enabled      = true;
                 this.image_icon.enabled = true;
                 this.text_count.enabled = false;
                 this.SetAniEnable(true);
                 this.image.set_sprite(SpriteManager.GetUICommon("UICommon_RedNode"));
                 this.image_icon.set_sprite(SpriteManager.GetUICommon("UICommon_RedNode_Combine"));
             }
         }
         else
         {
             this.image.enabled      = true;
             this.image_icon.enabled = false;
             this.text_count.enabled = true;
             this.SetAniEnable(false);
             this.image.set_sprite(SpriteManager.GetUICommon("UICommon_GreenNode"));
         }
     }
 }
 protected override TabNode GetTabNodeData()
 {
     return(new TabNode(CraftTree.Type.Workbench, "SeaTruckWBUpgrades", "Seatruck Upgrades", SpriteManager.Get(TechType.SeaTruck)));
 }
Esempio n. 47
0
        protected override void initializeSprites()
        {
            Transformation fadeInTrack = new TransformationF(TransformationType.Fade, 0, 1, StartTime - DifficultyManager.PreEmpt, StartTime - DifficultyManager.PreEmpt + DifficultyManager.FadeIn);
            Transformation fadeOut     = new TransformationF(TransformationType.Fade, 1, 0, EndTime, EndTime + DifficultyManager.HitWindow50);

            activeOverlay = new pSprite(TextureManager.Load(OsuTexture.holdactive), FieldTypes.GamefieldSprites, OriginTypes.Centre, ClockTypes.Audio, Position, SpriteManager.drawOrderBwd(EndTime - 18), false, Color.White);
            spriteCollectionStart.Add(activeOverlay);

            inactiveOverlay = new pSprite(TextureManager.Load(OsuTexture.holdinactive), FieldTypes.GamefieldSprites, OriginTypes.Centre, ClockTypes.Audio, Position, SpriteManager.drawOrderBwd(EndTime - 19), false, Color.White);
            inactiveOverlay.Transform(new NullTransform(StartTime, EndTime));
            spriteCollectionStart.Add(inactiveOverlay);

            border = new pSprite(TextureManager.Load(OsuTexture.holdoverlay), FieldTypes.GamefieldSprites, OriginTypes.Centre, ClockTypes.Audio, Position, SpriteManager.drawOrderBwd(EndTime - 20), false, Color.White);
            border.Transform(fadeInTrack);
            border.Transform(fadeOut);
            Sprites.Add(border);

            spriteCollectionStart.ForEach(s => s.Transform(fadeInTrack));
            spriteCollectionStart.ForEach(s => s.Transform(fadeOut));

            circularProgress          = new CircularProgress(position, 4, false, 0, Color.White);
            circularProgress.Clocking = ClockTypes.Audio;
            circularProgress.Field    = FieldTypes.GamefieldExact;
            circularProgress.Additive = true;
            circularProgress.Transform(new NullTransform(StartTime, EndTime));

            spriteCollectionStart.Add(circularProgress);

            Sprites.AddRange(spriteCollectionStart);

            activeOverlay.Transform(new TransformationC(hold_colour, Color4.White, StartTime, EndTime));
            circularProgress.Transform(new TransformationC(new Color4(hold_colour.R, hold_colour.G, hold_colour.B, 0.8f), ColourHelper.Lighten(new Color4(hold_colour.R, hold_colour.G, hold_colour.B, 0.8f), 0.5f),
                                                           StartTime, EndTime));

            border.TagNumeric          = DIMMABLE_TAG;
            inactiveOverlay.TagNumeric = DIMMABLE_TAG;
        }
Esempio n. 48
0
        public static void Load()
        {
            var assembly = Assembly.GetExecutingAssembly();

            HarmonyInstance.Create($"MrPurple6411_{assembly.GetName().Name}").PatchAll(assembly);

            CraftTreeHandler.AddTabNode(CraftTree.Type.Fabricator, "Posters", "Posters", SpriteManager.Get(TechType.PosterKitty));
            CraftTreeHandler.AddTabNode(CraftTree.Type.Fabricator, "Landscape", "Landscape", SpriteManager.Get(TechType.PosterAurora), "Posters");
            CraftTreeHandler.AddTabNode(CraftTree.Type.Fabricator, "Portrait", "Portrait", SpriteManager.Get(TechType.PosterExoSuit1), "Posters");
            foreach (string directory in Directory.GetDirectories(PosterFolder.FullName))
            {
                string info    = Path.Combine(directory, "info.json");
                string icon    = Path.Combine(directory, "icon.png");
                string texture = Path.Combine(directory, "texture.png");
                if (File.Exists(info) && File.Exists(icon) && File.Exists(texture))
                {
                    try
                    {
                        PosterInfo poster;
                        using (var reader = new StreamReader(info))
                        {
                            var serializer = new JsonSerializer();
                            poster = serializer.Deserialize(reader, typeof(PosterInfo)) as PosterInfo;
                        }

                        Texture2D icontexture   = ImageUtils.LoadTextureFromFile(icon);
                        Texture2D posterTexture = ImageUtils.LoadTextureFromFile(texture);

                        if (poster != null && icontexture != null && posterTexture != null)
                        {
                            var prefab = new BasicPostersPrefab(poster.InternalName, poster.DisplayName, poster.Description, poster.Orientation, icontexture, posterTexture);
                            prefab.Patch();
                            CraftDataHandler.SetQuickSlotType(prefab.TechType, QuickSlotType.Selectable);
                        }
                        else
                        {
                            Console.WriteLine($"[{ModName}] Unable to load Custom Poster from {Path.GetDirectoryName(directory)}!");
                        }
                    }
                    catch (Exception)
                    {
                        Console.WriteLine($"[{ModName}] Unable to load Custom Poster from {Path.GetDirectoryName(directory)}!");
                    }
                }
            }
        }
Esempio n. 49
0
        internal static void PatchCraftingTabs()
        {
            if (CraftingTabsPatched)
            {
                return; // Just a safety
            }
            QuickLogger.Info("Separating batteries and power cells into their own fabricator crafting tabs");

            // Remove original crafting nodes
            CraftTreeHandler.RemoveNode(CraftTree.Type.Fabricator, ResCraftTab, ElecCraftTab, TechType.Battery.ToString());
            CraftTreeHandler.RemoveNode(CraftTree.Type.Fabricator, ResCraftTab, ElecCraftTab, TechType.PrecursorIonBattery.ToString());
            CraftTreeHandler.RemoveNode(CraftTree.Type.Fabricator, ResCraftTab, ElecCraftTab, TechType.PowerCell.ToString());
            CraftTreeHandler.RemoveNode(CraftTree.Type.Fabricator, ResCraftTab, ElecCraftTab, TechType.PrecursorIonPowerCell.ToString());

            // Add a new set of tab nodes for batteries and power cells
            CraftTreeHandler.AddTabNode(CraftTree.Type.Fabricator, BatteryCraftTab, "Batteries", SpriteManager.Get(TechType.Battery), ResCraftTab, ElecCraftTab);
            CraftTreeHandler.AddTabNode(CraftTree.Type.Fabricator, PowCellCraftTab, "Power Cells", SpriteManager.Get(TechType.PowerCell), ResCraftTab, ElecCraftTab);

            // Move the original batteries and power cells into these new tabs
            CraftTreeHandler.AddCraftingNode(CraftTree.Type.Fabricator, TechType.Battery, BatteryCraftPath);
            CraftTreeHandler.AddCraftingNode(CraftTree.Type.Fabricator, TechType.PrecursorIonBattery, BatteryCraftPath);
            CraftTreeHandler.AddCraftingNode(CraftTree.Type.Fabricator, TechType.PowerCell, PowCellCraftPath);
            CraftTreeHandler.AddCraftingNode(CraftTree.Type.Fabricator, TechType.PrecursorIonPowerCell, PowCellCraftPath);

            CraftingTabsPatched = true;
        }
Esempio n. 50
0
 // Use this for initialization
 void Start()
 {
     spriteManager = GetComponent <SpriteManager> ();
 }
Esempio n. 51
0
        internal Options(Game game) : base(game)
        {
            KeyboardHandler.OnKeyPressed += GameBase_OnKeyPressed;

            spriteManager         = new SpriteManager();
            spriteManagerAudio    = new SpriteManager();
            spriteManagerGraphics = new SpriteManager();
            spriteManagerInput    = new SpriteManager();
            spriteManagerOnline   = new SpriteManager();

            int vertSpacing = 30;

            startOffset = ConfigManager.sOffset;

            int t = ConfigManager.sComboFireHeight;

            ConfigManager.sComboFireHeight = 10;
            fireRender = new FireRenderer();
            ConfigManager.sComboFireHeight = t;

            SkinManager.LoadSkin();

            pSprite detailsBack =
                new pSprite(GameBase.WhitePixel, FieldTypes.Window,
                            OriginTypes.TopLeft,
                            ClockTypes.Game,
                            new Vector2(0, 0), 0.7F, true, Color.Black);

            detailsBack.VectorScale    = new Vector2(1024, 83);
            detailsBack.UseVectorScale = true;
            spriteManager.Add(detailsBack);

            pText version = new pText("osu! " + General.BUILD_NAME, 10, new Vector2(640, 0), 0.99f, true, Color.White);

            version.OriginType         = OriginTypes.TopRight;
            version.TextRenderSpecific = false;
            version.TextAa             = false;
            spriteManager.Add(version);

            pTabCollection ptab = new pTabCollection(spriteManager, 10, new Vector2(230, 52), 0.9f, true);

            ptab.TabColour = Color.Tomato;
            ptab.Add("Graphics", spriteManagerGraphics);
            ptab.Add("Audio", spriteManagerAudio);
            ptab.Add("Input", spriteManagerInput);
            ptab.Add("Online", spriteManagerOnline);

            ptab.OnTabChanged += pt_OnTabChanged;

            ptab.SetSelected(spriteManagerGraphics);

            pAnimation back =
                new pAnimation(SkinManager.LoadAll("menu-back"), FieldTypes.Window,
                               OriginTypes.TopLeft,
                               ClockTypes.Game,
                               new Vector2(0, 480), 0.8F, true, new Color(255, 255, 255, (byte)(255 * 0.6)));

            back.SetFramerateFromSkin();
            back.OriginPosition = new Vector2(0, 146);
            back.OnClick       += back_OnClick;
            back.IsClickable    = true;
            back.HoverEffect    = new Transformation(TransformationType.Fade, 0.6F, 1, 0, 300);
            spriteManager.Add(back);

            pText headerText =
                new pText("Options", 30, new Vector2(0, 0), 0.955F, true, new Color(255, 255, 255, 255));

            spriteManager.Add(headerText);

            pText headerText2 = new pText("Change the way osu! behaves", 16, new Vector2(4, 26), 0.955F, true,
                                          new Color(255, 255, 255, 255));

            spriteManager.Add(headerText2);

            pSprite bg =
                new pSprite(SkinManager.Load("playfield"), FieldTypes.Window, OriginTypes.TopLeft,
                            ClockTypes.Game, Vector2.Zero, 0, true, new Color(44, 82, 108));

            spriteManager.Add(bg);

            //Graphics-related

            int vertCurrent = topHeight;

            pText pt =
                new pText("Resolution", 24, new Vector2(160, vertCurrent), Vector2.Zero, 1, true, Color.White, true);

            pt.OriginType = OriginTypes.Centre;
            spriteManagerGraphics.Add(pt);

            vertCurrent += vertSpacing;

            pc640 = new pCheckbox(spriteManagerGraphics, "640x480", new Vector2(10, vertCurrent), 0.8F, false);
            pc640.OnCheckChanged += delegate
            {
                GameBase.SetScreenSize(640, 480);
                UpdateResolutionCheckboxes();
            };

            pc1024 = new pCheckbox(spriteManagerGraphics, "1024x768", new Vector2(160, vertCurrent), 0.8F, false);
            pc1024.OnCheckChanged += delegate
            {
                GameBase.SetScreenSize(1024, 768);
                UpdateResolutionCheckboxes();
            };

            vertCurrent += vertSpacing;


            pc800 = new pCheckbox(spriteManagerGraphics, "800x600", new Vector2(10, vertCurrent), 0.8F, false);
            pc800.OnCheckChanged += delegate
            {
                GameBase.SetScreenSize(800, 600);
                UpdateResolutionCheckboxes();
            };

            pCheckbox pc = new pCheckbox(spriteManagerGraphics, "Fullscreen Mode", new Vector2(160, vertCurrent), 0.8F,
                                         ConfigManager.sFullscreen);

            pc.OnCheckChanged += fullscreen_OnCheckChanged;

            UpdateResolutionCheckboxes();


            vertCurrent += vertSpacing + 40;

            pt =
                new pText("Detail Settings", 24, new Vector2(320, vertCurrent), Vector2.Zero, 1, true, Color.White,
                          true);
            pt.OriginType = OriginTypes.Centre;
            spriteManagerGraphics.Add(pt);

            vertCurrent += vertSpacing;

            pc = new pCheckbox(spriteManagerGraphics, "Limit Framerate", new Vector2(10, vertCurrent), 0.8F,
                               ConfigManager.sFrameSync);
            pc.Tooltip =
                "Limits all internal calculations to 60fps.\nThis will help fix lag problems - try toggling it if you experience lag!";
            pc.OnCheckChanged += frameSync_OnClick;

            pc = new pCheckbox(spriteManagerGraphics, "Snaking Sliders", new Vector2(160, vertCurrent), 0.8F,
                               ConfigManager.sSnakingSliders);
            pc.Tooltip =
                "Sliders gradually snake out from their starting point.\nThis should run fine unless you have an ancient machine.";
            pc.OnCheckChanged += snakingSliders_OnClick;

            vertCurrent += vertSpacing;

            pc = new pCheckbox(spriteManagerGraphics, "Background Video", new Vector2(10, vertCurrent), 0.8F,
                               ConfigManager.sVideo);
            pc.Tooltip =
                "Enable full-window video playback.\nThis requires ffdshow (available from the osu! site).\nNote that if your ffdshow doesn't have a red system-tray icon, it is outdated and will not work correctly";
            pc.OnCheckChanged += video_OnClick;

            pc = new pCheckbox(spriteManagerGraphics, "Shader Effects", new Vector2(160, vertCurrent), 0.8F,
                               ConfigManager.sBloom);
            pc.Tooltip =
                "Enables application of a softening and other shader special effects in gameplay.\nThis requires Pixel Shader 2.0 support, and a relatively powerful PC.\nIf your card is unsupported, this will be automatically disabled.";
            pc.OnCheckChanged += bloom_OnClick;

            vertCurrent += vertSpacing;

            pc = new pCheckbox(spriteManagerGraphics, "Show Combo Fire", new Vector2(10, vertCurrent), 0.8F,
                               ConfigManager.sComboFire);
            pc.Tooltip =
                "When you achieve a combo of 30 or greater, fire will burn from the bottom of the screen.\nThis requires Pixel Shader 2.0 support.\nIf your card is unsupported, this will be automatically disabled.";
            pc.OnCheckChanged += comboFire_OnClick;

            comboFireHeight = new pSliderBar(spriteManagerGraphics, 0, 10, ConfigManager.sComboFireHeight,
                                             new Vector2(150, vertCurrent + 10), 120);
            comboFireHeight.SpriteCollection[1].ToolTip = "Adjust the maximum height of combo fire.";
            comboFireHeight.Visible = ConfigManager.sComboFire;

            vertCurrent = topHeight;

            vertSpacing = 35;

            vertCurrent += vertSpacing;

            pSprite pb =
                new pText("Skin", 24, new Vector2(480, vertCurrent - 16), Vector2.Zero, 1, true, Color.White, true);

            pb.OriginType = OriginTypes.Centre;
            spriteManagerGraphics.Add(pb);

            pb =
                new pSprite(SkinManager.Load("hit300g"), FieldTypes.Window,
                            OriginTypes.Centre,
                            ClockTypes.Game,
                            new Vector2(400, vertCurrent - 16), 0.3F, true, Color.White);
            pb.CurrentScale = 0.8F;
            spriteManagerGraphics.Add(pb);

            pb =
                new pSprite(SkinManager.Load("hit100k"), FieldTypes.Window,
                            OriginTypes.Centre,
                            ClockTypes.Game,
                            new Vector2(560, vertCurrent - 16), 0.3F, true, Color.White);
            pb.CurrentScale = 0.8F;
            spriteManagerGraphics.Add(pb);

            vertCurrent += vertSpacing;

            skinText =
                new pText(SkinManager.Current.SkinName + " by " + SkinManager.Current.SkinAuthor, 20,
                          new Vector2(480, vertCurrent), Vector2.Zero, 1, true, Color.Black, false);
            skinText.OriginType = OriginTypes.Centre;
            spriteManagerGraphics.Add(skinText);

            pb =
                new pSprite(SkinManager.Load("menu-button-background"), FieldTypes.Window,
                            OriginTypes.Centre,
                            ClockTypes.Game,
                            new Vector2(480, vertCurrent), 0.8F, true, Color.White);
            pb.OnClick      += changeSkin_OnClick;
            pb.CurrentScale  = 0.7F;
            pb.CurrentColour = new Color(0, 0, 0, 178);
            pb.IsClickable   = true;
            pb.HoverEffect   = new Transformation(TransformationType.Fade, 0.7F, 1, 0, 200);
            spriteManagerGraphics.Add(pb);

            //Audio
            vertCurrent = topHeight;

            pb =
                new pText("Volume", 24, new Vector2(320, vertCurrent), Vector2.Zero, 1, true, Color.White, true);
            pb.OriginType = OriginTypes.Centre;
            spriteManagerAudio.Add(pb);

            vertCurrent += vertSpacing - 8;

            vertSpacing = 25;

            pb =
                new pText("Master", 20, new Vector2(230, vertCurrent), Vector2.Zero, 1, true, Color.White, true);
            pb.OriginType = OriginTypes.Centre;
            spriteManagerAudio.Add(pb);

            masterVolume =
                new pSliderBar(spriteManagerAudio, 0, 100, AudioEngine.VolumeUniversal, new Vector2(280, vertCurrent), 180);

            vertCurrent += vertSpacing;

            pb =
                new pText("Music", 20, new Vector2(230, vertCurrent), Vector2.Zero, 1, true, Color.White, true);
            pb.OriginType = OriginTypes.Centre;
            spriteManagerAudio.Add(pb);

            musicVolume =
                new pSliderBar(spriteManagerAudio, 0, 100, AudioEngine.VolumeMusic, new Vector2(280, vertCurrent), 180);

            vertCurrent += vertSpacing;

            pb            = new pText("Effect", 20, new Vector2(230, vertCurrent), Vector2.Zero, 1, true, Color.White, true);
            pb.OriginType = OriginTypes.Centre;
            spriteManagerAudio.Add(pb);
            vertSpacing = 35;

            effectVolume =
                new pSliderBar(spriteManagerAudio, 0, 100, AudioEngine.VolumeEffect, new Vector2(280, vertCurrent), 180);

            vertCurrent += vertSpacing * 3;

            pb =
                new pText("Universal Audio Offset", 20, new Vector2(320, vertCurrent), Vector2.Zero, 1, true,
                          Color.White, true);
            pb.OriginType = OriginTypes.Centre;
            spriteManagerAudio.Add(pb);

            vertCurrent += 25;

            pb =
                new pText(
                    "Use left/right arrows to adjust until you can no longer hear the two\nseparate sounds.  This is not perfect, but will be improved soon.",
                    12, new Vector2(320, vertCurrent), Vector2.Zero, 1, true, Color.White, true);
            pb.OriginType = OriginTypes.Centre;
            spriteManagerAudio.Add(pb);

            vertCurrent += vertSpacing;

            audioOffset =
                new pSliderBar(spriteManagerAudio, -300, 300, ConfigManager.sOffset, new Vector2(180, vertCurrent), 200);

            audioOffsetText =
                new pText("", 20, new Vector2(440, vertCurrent), Vector2.Zero, 1, true, Color.White, true);
            audioOffsetText.OriginType = OriginTypes.Centre;
            spriteManagerAudio.Add(audioOffsetText);

            //Input
            vertCurrent = topHeight;

            pb =
                new pText("Mouse Sensitivity", 24, new Vector2(480, vertCurrent), Vector2.Zero, 1, true, Color.White,
                          true);
            pb.OriginType = OriginTypes.Centre;
            spriteManagerInput.Add(pb);

            vertCurrent += vertSpacing;

            pb = new pText("The default rate is the same as your desktop mouse speed.", 14,
                           new Vector2(480, vertCurrent), Vector2.Zero, 1, true, Color.White, true);
            pb.OriginType = OriginTypes.Centre;
            spriteManagerInput.Add(pb);

            vertCurrent += vertSpacing;

            mouseSpeed =
                new pSliderBar(spriteManagerInput, 0.5, 4, ConfigManager.sMouseSpeed, new Vector2(370, vertCurrent), 200);

            mouseSpeedText =
                new pText("", 20, new Vector2(600, vertCurrent), Vector2.Zero, 1, true, Color.White, true);
            mouseSpeedText.OriginType = OriginTypes.Centre;
            spriteManagerInput.Add(mouseSpeedText);

            vertCurrent = topHeight;

            pt =
                new pText("Toggles", 24, new Vector2(160, vertCurrent), Vector2.Zero, 1, true, Color.White, true);
            pt.OriginType = OriginTypes.Centre;
            spriteManagerInput.Add(pt);
            vertCurrent += vertSpacing;

            pc = new pCheckbox(spriteManagerInput, "Disable mouse wheel in play mode", new Vector2(10, vertCurrent), 0.8F,
                               ConfigManager.sMouseDisableWheel);
            pc.Tooltip =
                "During play, you can use the mouse wheel to adjust the volume and pause the game.\nThis will disable that functionality";
            pc.OnCheckChanged += disableMouseWheel_OnClick;

            vertCurrent += vertSpacing;

            pc = new pCheckbox(spriteManagerInput, "Disable mouse buttons in play mode", new Vector2(10, vertCurrent), 0.8F,
                               ConfigManager.sMouseDisableButtons);
            pc.Tooltip =
                "This option will disable all mouse buttons.\nSpecifically for people who use Z/X/Ctrl/Space to click.";
            pc.OnCheckChanged += disableMouseButtons_OnClick;

            vertCurrent += vertSpacing;

            pc = new pCheckbox(spriteManagerInput, "Force TabletPC support", new Vector2(10, vertCurrent), 0.8F,
                               ConfigManager.sTablet);
            pc.Tooltip =
                "osu! attempts to auto-detect if you are running on a tablet PC.\nThis sometimes fails depending on the operating sytem.\nEnable this if you are running a TabletPC or using a tablet and your clicks aren't handled correctly.";
            pc.OnCheckChanged += tablet_OnClick;

            vertCurrent += vertSpacing;

            pt =
                new pText("Key Bindings", 24, new Vector2(320, vertCurrent), Vector2.Zero, 1, true, Color.White, true);
            pt.OriginType = OriginTypes.Centre;
            spriteManagerInput.Add(pt);
            vertCurrent += vertSpacing - 10;

            pt1 = new pText(ConfigManager.sKeyboardBind1.ToString(), 24, new Vector2(330, vertCurrent), Vector2.Zero, 1, true, Color.White, true);
            pButton pbutton = new pButton("Main 1 (Taiko Inner-Left)", new Vector2(20, vertCurrent), new Vector2(260, 30), 0.9f, Color.DarkOrange, delegate { GameBase.ShowDialog(new OptionsBindKey(delegate(object sender, EventArgs e) { ConfigManager.sKeyboardBind1 = (Keys)sender; InputManager.CheckBindings(); UpdateBindings(); }, "Binding: Main 1 (Taiko Centre-Left)")); });

            spriteManagerInput.AddRange(pbutton.SpriteCollection);
            spriteManagerInput.Add(pt1);
            vertCurrent += vertSpacing;

            pt2     = new pText(ConfigManager.sKeyboardBind3.ToString(), 24, new Vector2(330, vertCurrent), Vector2.Zero, 1, true, Color.White, true);
            pbutton = new pButton("Main 2 (Taiko Inner-Right)", new Vector2(20, vertCurrent), new Vector2(260, 30), 0.9f, Color.DarkOrange, delegate { GameBase.ShowDialog(new OptionsBindKey(delegate(object sender, EventArgs e) { ConfigManager.sKeyboardBind3 = (Keys)sender; InputManager.CheckBindings(); UpdateBindings(); }, "Binding: Main 2 (Taiko Inner-Right)")); });
            spriteManagerInput.AddRange(pbutton.SpriteCollection);
            spriteManagerInput.Add(pt2);
            vertCurrent += vertSpacing;

            pt3     = new pText(ConfigManager.sKeyboardBind2.ToString(), 24, new Vector2(330, vertCurrent), Vector2.Zero, 1, true, Color.White, true);
            pbutton = new pButton("Alt 1 (Taiko Outer-Left)", new Vector2(20, vertCurrent), new Vector2(260, 30), 0.9f, Color.DarkOrange, delegate { GameBase.ShowDialog(new OptionsBindKey(delegate(object sender, EventArgs e) { ConfigManager.sKeyboardBind2 = (Keys)sender; InputManager.CheckBindings(); UpdateBindings(); }, "Binding: Alt 1 (Taiko Outer-Left)")); });
            spriteManagerInput.AddRange(pbutton.SpriteCollection);
            spriteManagerInput.Add(pt3);
            vertCurrent += vertSpacing;

            pt4     = new pText(ConfigManager.sKeyboardBind4.ToString(), 24, new Vector2(330, vertCurrent), Vector2.Zero, 1, true, Color.White, true);
            pbutton = new pButton("Alt 2 (Taiko Outer-Right)", new Vector2(20, vertCurrent), new Vector2(260, 30), 0.9f, Color.DarkOrange, delegate { GameBase.ShowDialog(new OptionsBindKey(delegate(object sender, EventArgs e) { ConfigManager.sKeyboardBind4 = (Keys)sender; InputManager.CheckBindings(); UpdateBindings(); }, "Binding: Alt 2 (Taiko Outer-Right)")); });
            spriteManagerInput.AddRange(pbutton.SpriteCollection);
            spriteManagerInput.Add(pt4);



            //Online
            vertCurrent = topHeight;

            pb =
                new pText("Toggles", 24, new Vector2(160, vertCurrent), Vector2.Zero, 1, true, Color.White, true);
            pb.OriginType = OriginTypes.Centre;
            spriteManagerOnline.Add(pb);

            vertCurrent += vertSpacing;

            pCheckbox pc1 = new pCheckbox(spriteManagerOnline, "Show chat ticker", new Vector2(10, vertCurrent), 0.8F,
                                          ConfigManager.sTicker);

            pc1.Tooltip         = "Popup new chat messages in a one-line display at the bottom of the screen\nwhen the chat console is not visible";
            pc1.OnCheckChanged += delegate { ChatEngine.ticker_OnClick(null, null); pc1.SetStatusQuietly(ConfigManager.sTicker); };

            vertCurrent += vertSpacing;

            pCheckbox pc2 = new pCheckbox(spriteManagerOnline, "Automatically hide chat", new Vector2(10, vertCurrent), 0.8F,
                                          ConfigManager.sAutoChatHide);

            pc2.Tooltip         = "When enabled, chat will automatically hide itself during gameplay.\nIt will be visible during breaks and intro/outro time.";
            pc2.OnCheckChanged += delegate { ChatEngine.hideMode_OnClick(null, null); pc2.SetStatusQuietly(ConfigManager.sAutoChatHide); };

            vertCurrent += vertSpacing;

            pCheckbox pc3 = new pCheckbox(spriteManagerOnline, "Popup notification when someone says your name", new Vector2(10, vertCurrent), 0.8F,
                                          ConfigManager.sChatHighlightName);

            pc3.Tooltip         = "A message will flash at the bottom of your screen (even during gameplay)\nwhen someone mentions yourname in chat.";
            pc3.OnCheckChanged += delegate { ConfigManager.sChatHighlightName = !ConfigManager.sChatHighlightName; pc3.SetStatusQuietly(ConfigManager.sChatHighlightName); };

            vertCurrent += vertSpacing;

            pCheckbox pc4 = new pCheckbox(spriteManagerOnline, "Share your city location with others", new Vector2(10, vertCurrent), 0.8F,
                                          ConfigManager.sDisplayCityLocation);

            pc4.Tooltip         = "By default, other users will only be able to see your country.  Enabling this adds your city to the\npublicly visible location.  This is usually quite accurate.";
            pc4.OnCheckChanged += delegate { ConfigManager.sDisplayCityLocation = !ConfigManager.sDisplayCityLocation; pc4.SetStatusQuietly(ConfigManager.sDisplayCityLocation); };

            vertCurrent = topHeight;

            pb =
                new pText("Active User", 24, new Vector2(480, vertCurrent), Vector2.Zero, 1, true, Color.White, true);
            pb.OriginType = OriginTypes.Centre;
            spriteManagerOnline.Add(pb);

            vertCurrent += vertSpacing;

            pb =
                new pSprite(SkinManager.Load("menu-button-background"), FieldTypes.Window,
                            OriginTypes.Centre,
                            ClockTypes.Game,
                            new Vector2(480, vertCurrent), 0.8F, true, Color.White);
            pb.OnClick      += provideLogin_OnClick;
            pb.CurrentScale  = 0.7F;
            pb.CurrentColour = new Color(0, 0, 0, 178);
            pb.IsClickable   = true;
            pb.HoverEffect   = new Transformation(TransformationType.Fade, 0.7F, 1, 0, 200);
            spriteManagerOnline.Add(pb);

            account =
                new pText("Click to login!", 20, new Vector2(480, vertCurrent), Vector2.Zero, 1, true, Color.Black,
                          false);
            account.OriginType = OriginTypes.Centre;
            spriteManagerOnline.Add(account);

            updateAccount();


            GameBase.LoadComplete();
        }
Esempio n. 52
0
    // Start is called before the first frame update
    void Start()
    {
        var componentDataQuery =
            from domainAssembly in AppDomain.CurrentDomain.GetAssemblies()
            from type in domainAssembly.GetLoadableTypes()
            where type != null && typeof(IComponentData).IsAssignableFrom(type) && !type.IsAbstract && type.IsPublic
            orderby type.Name
            select type;

        StringBuilder sb = new StringBuilder();

        foreach (var value in componentDataQuery)
        {
            sb.Append($"{value.Name}, ");
            componentTypeDictionary.Add(value.Name, value);
        }
        Debug.Log(sb);

        XmlLoader xmlLoader = new XmlLoader(Application.streamingAssetsPath + @"\ExampleMod\Units\TestUnit.xml");
        XmlUnit   unit      = (XmlUnit)xmlLoader.XmlObject;

        EntityManager EntityManager = World.Active.EntityManager;

        EntityArchetype playerArchtype = EntityManager.CreateArchetype(
            ComponentTypesFromUnit(unit)
            );

        Entity     entity     = EntityManager.CreateEntity(playerArchtype);
        GameObject gameObject = Instantiate(spritePrefab);

        int spriteSheetIndex = CheckSpriteSheetsForMatch(spriteSheets, unit.SpritePath);

        if (spriteSheetIndex == -1)
        {
            FileInfo spriteFile = new FileInfo(Application.streamingAssetsPath + "/" + unit.SpritePath);

            spriteSheets.Add(new SpriteSheet()
            {
                Name = unit.SpritePath, Sprites = GetSpriteSheetFromFile(spriteFile)
            });
            spriteSheetIndex = spriteSheets.Count - 1;
        }
        Sprite[] spritesArray = spriteSheets[spriteSheetIndex].Sprites;
        gameObject.GetComponent <SpriteRenderer>().sprite = spritesArray[unit.SpritePosition];

        //Sprite sprite = spriteSheets[spriteSheetIndex].Sprites[unit.SpritePosition];
        //gameObject.GetComponent<SpriteRenderer>().sprite = sprite;

        //List<SpriteSheet> sheets = spriteSheets;
        //gameObject.GetComponent<SpriteRenderer>().sprite = sheets[spriteSheetIndex].Sprites[unit.SpritePosition];

        //gameObject.GetComponent<SpriteRenderer>().sprite = spriteSheets[spriteSheetIndex].Sprites[unit.SpritePosition];

        int visualID = SpriteManager.RegisterVisualGameObjectAndReturnKey(gameObject);

        EntityManager.SetComponentData(entity, new SpriteToGameObject
        {
            VisualID = visualID
        });

        var staminaIndex = unit.Components.Select((value, index) => new { value, index = index + 1 })
                           .Where(pair => pair.value.Name == "Stamina")
                           .Select(pair => pair.index)
                           .FirstOrDefault() - 1;

        Debug.Log($"The stamina to start is {unit.Components[staminaIndex].Values[0]}");

        EntityManager.SetComponentData(entity, new Stamina
        {
            Value          = 5,
            StaminaCap     = 20,
            StaminaPerTurn = 2
        });
    }
Esempio n. 53
0
 protected override Sprite GetItemSprite()
 {
     return((icon != null && icon != SpriteManager.defaultSprite) ? icon : SpriteManager.Get(TechType.HighCapacityTank));
 }
Esempio n. 54
0
 protected override Atlas.Sprite GetItemSprite()
 {
     return(SpriteManager.Get(TechType.VehicleHullModule3));
 }
Esempio n. 55
0
 protected override void Awake()
 {
     base.Awake();
     sprites = SpriteManager.Load();
     AddPhotoCell();
 }
Esempio n. 56
0
        public void Init()
        {
            bool bUpdated = false;

            if (bManualRefill)
            {
                Log.LogDebug($"Config.Init(): Adding tab node for oxygen tank refills");
                CraftTreeHandler.AddTabNode(CraftTree.Type.Fabricator, "TankRefill", "Tank Refills", SpriteManager.Get(TechType.DoubleTank), new string[] { "Personal" });
            }
            if (CapacityOverrides == null || CapacityOverrides.Count < 1)
            {
                CapacityOverrides = new Dictionary <string, float>();
                bUpdated          = true;
            }

            foreach (KeyValuePair <string, float> kvp in CapacityOverrides)
            {
                TechType tt = TechTypeUtils.GetTechType(kvp.Key);
                if (tt == TechType.None)
                {
#if !RELEASE
                    Logger.Log(Logger.Level.Debug, $"Failed to load TechType for string '{kvp.Key}'");
#endif
                    continue;
                }

                SetCapacityOverride(tt, kvp.Value, false, false, false);
            }

            if (manualCapacityOverrides == null || manualCapacityOverrides.Count < 1)
            {
                manualCapacityOverrides = new Dictionary <string, float>();
                bUpdated = true;
            }

            foreach (KeyValuePair <string, float> kvp in manualCapacityOverrides)
            {
                TechType tt = TechTypeUtils.GetTechType(kvp.Key);
                if (tt == TechType.None)
                {
#if !RELEASE
                    Logger.Log(Logger.Level.Debug, $"Failed to load TechType for string '{kvp.Key}'");
#endif
                    continue;
                }

                SetCapacityOverride(tt, kvp.Value, false, false, true);
            }

            if (bUpdated)
            {
                Save();
#if !RELEASE
                Logger.Log(Logger.Level.Debug, "Some values reset to defaults");
#endif
            }
            else
            {
#if !RELEASE
                Logger.Log(Logger.Level.Debug, "All values present and correct");
#endif
            }
        }
Esempio n. 57
0
        public void SetPixel(Color c, int x, int y)
        {
            var ti = SpriteManager.GetTextureInfo(name, path);

            ti.texture.SetPixel(x, y, new UnityEngine.Color(c.r, c.g, c.b, c.a));
        }
Esempio n. 58
0
        internal virtual void InitializeSprites()
        {
            newStyleSpinner = SkinManager.UseNewLayout && (SkinManager.IgnoreBeatmapSkin || TextureManager.Load(@"spinner-circle", SkinSource.Beatmap) == null) && TextureManager.Load(@"spinner-background", SkinSource.Skin) == null;

            if (GameBase.GameField.CorrectionOffsetActive)
            {
                spinnerTopOffset -= 16;
            }

            //this is madness, but works.
            posTopLeftCentre = new Vector2(GameBase.WindowManager.WidthScaled / Math.Max(1, GameBase.WindowManager.WidthWidescreenRatio) / 2f, spinnerTopOffset + 219);

            Color initialColour = (GameBase.Mode == OsuModes.Play && Player.currentScore != null && (ModManager.CheckActive(hitObjectManager.ActiveMods, Mods.SpunOut) || Player.Relaxing2) ? Color.Gray : Color.White);

            if (GameBase.Mode == OsuModes.Play && SkinManager.Current.SpinnerFadePlayfield)
            {
                //we need to add a backing layer as this skin requests the playfield is hidden while the spinner is present.

                SpriteCollection.Add(new pSprite(GameBase.WhitePixel, Fields.TopLeft, Origins.TopLeft, Clocks.Audio, new Vector2(0, 0), SpriteManager.drawOrderFwdLowPrio(StartTime - 1), false, Color.Black)
                {
                    Scale       = 1.6f,
                    VectorScale = new Vector2(640, spinnerTopOffset)
                });

                if (GameBase.GameField.CorrectionOffsetActive)
                {
                    SpriteCollection.Add(new pSprite(GameBase.WhitePixel, Fields.TopLeft, Origins.TopLeft, Clocks.Audio, new Vector2(0, 480 - 19), SpriteManager.drawOrderFwdLowPrio(StartTime - 1), false, Color.Black)
                    {
                        Scale       = 1.6f,
                        VectorScale = new Vector2(640, 19) //Use 19 here instead of 16 as the spinner-background graphic seems a little short...
                    });
                }
            }

            if (newStyleSpinner)
            {
                SpriteCircleTop = new pSprite(TextureManager.Load(@"spinner-top"), Fields.TopLeft, Origins.Centre, Clocks.Audio, posTopLeftCentre, SpriteManager.drawOrderFwdLowPrio(StartTime + 1), false, initialColour);
                SpriteCollection.Add(SpriteCircleTop);

                spriteCircleBottom = new pSprite(TextureManager.Load(@"spinner-bottom"), Fields.TopLeft, Origins.Centre, Clocks.Audio, posTopLeftCentre, SpriteManager.drawOrderFwdLowPrio(StartTime), false, initialColour);
                SpriteCollection.Add(spriteCircleBottom);

                spriteMiddleTop = new pSprite(TextureManager.Load(@"spinner-middle"), Fields.TopLeft, Origins.Centre, Clocks.Audio, posTopLeftCentre, SpriteManager.drawOrderFwdLowPrio(StartTime + 3), false, Color.TransparentWhite);
                SpriteCollection.Add(spriteMiddleTop);

                spriteMiddleBottom = new pSprite(TextureManager.Load(@"spinner-middle2"), Fields.TopLeft, Origins.Centre, Clocks.Audio, posTopLeftCentre, SpriteManager.drawOrderFwdLowPrio(StartTime + 2), false, Color.TransparentWhite);
                SpriteCollection.Add(spriteMiddleBottom);
            }
            else
            {
                pTexture bgTexture = null;
                //Check for a jpg background for beatmap-based skins (used to reduce filesize), then fallback to png.
                if (!SkinManager.IgnoreBeatmapSkin)
                {
                    bgTexture = TextureManager.Load(@"spinner-background.jpg", SkinSource.Beatmap);
                }
                if (bgTexture == null)
                {
                    bgTexture = TextureManager.Load(@"spinner-background", SkinSource.Beatmap | SkinSource.Skin);
                }

                Color bgColour = SkinManager.Colours.ContainsKey(@"SpinnerBackground") ? SkinManager.Colours[@"SpinnerBackground"] : new Color(100, 100, 100, 255);
                spriteBackground = new pSprite(bgTexture, Fields.TopLeft, Origins.Centre, Clocks.Audio, posTopLeftCentre, SpriteManager.drawOrderFwdLowPrio(StartTime - 1), false, bgColour);
                SpriteCollection.Add(spriteBackground);

                SpriteCircleTop = new pSprite(TextureManager.Load(@"spinner-circle"), Fields.TopLeft, Origins.Centre, Clocks.Audio, posTopLeftCentre, SpriteManager.drawOrderFwdLowPrio(StartTime), false, initialColour);
                SpriteCollection.Add(SpriteCircleTop);

                spriteScoreMetre            = new pSprite(TextureManager.Load(@"spinner-metre"), Fields.TopLeft, Origins.TopLeft, Clocks.Audio, new Vector2(posTopLeftCentre.X - 320, spinnerTopOffset), SpriteManager.drawOrderFwdLowPrio(StartTime + 1), false, initialColour);
                spriteScoreMetre.DrawHeight = 0;
                SpriteCollection.Add(spriteScoreMetre);
            }

            if (GameBase.Mode == OsuModes.Play)
            {
                spriteRpmBackground = new pSprite(TextureManager.Load(@"spinner-rpm"), Fields.TopLeft, Origins.TopLeft, Clocks.Audio, new Vector2(posTopLeftCentre.X - 87, 445), SpriteManager.drawOrderFwdLowPrio(StartTime + 3), false, initialColour);

                spriteRpmText = new pSpriteText("", SkinManager.Current.FontScore, SkinManager.Current.FontScoreOverlap, Fields.TopLeft, Origins.TopRight, Clocks.Audio, new Vector2(posTopLeftCentre.X + 80, 448), SpriteManager.drawOrderFwdLowPrio(StartTime + 4), false, initialColour)
                {
                    Scale = 0.9f
                };

                SpriteCollection.Add(spriteRpmText);
                SpriteCollection.Add(spriteRpmBackground);
            }

            if (SpriteCircleTop.Texture.Source != SkinSource.Osu && (!ModManager.CheckActive(hitObjectManager.ActiveMods, Mods.Hidden)))
            {
                SpriteApproachCircle = new pSprite(TextureManager.Load(@"spinner-approachcircle"), Fields.TopLeft, Origins.Centre, Clocks.Audio, posTopLeftCentre, SpriteManager.drawOrderFwdLowPrio(StartTime + 2), false, initialColour);
                SpriteCollection.Add(SpriteApproachCircle);
            }

            SpriteBonusCounter = new pSpriteText(string.Empty, SkinManager.Current.FontScore, SkinManager.Current.FontScoreOverlap, Fields.TopLeft, Origins.Centre, Clocks.Audio,
                                                 new Vector2(posTopLeftCentre.X, spinnerTopOffset + 299), SpriteManager.drawOrderFwdLowPrio(StartTime + 3), false, initialColour);

            SpriteCollection.Add(SpriteBonusCounter);
        }
Esempio n. 59
0
 public RyuAnimSet(Sprite sprite, SpriteManager sm)
 {
     this.sprite = sprite;
     this.sm     = sm;
     AddAnimations();
 }
Esempio n. 60
0
 public void Destroy()
 {
     SpriteManager.RemoveSprite(frbButton);
     ShapeManager.Remove(frbCollision);
     SpriteManager.RemovePositionedObject(this);
 }