Beispiel #1
0
    void setCountry(string countryCode)
    {
        ImageTexture texture = new ImageTexture();

        texture.Load($"Resources/Graphics/Flags/{countryCode}.png");
        country.Texture = texture;
    }
Beispiel #2
0
    void loadBody(StadiumObject stadiumObject)
    {
        StaticBody2D body = new StaticBody2D();

        ImageTexture texture = new ImageTexture();

        texture.Load(stadiumObject.TexturePath);
        Sprite sprite = new Sprite();

        sprite.Texture = texture;
        if (stadiumObject.Shape == StadiumObject.Type.RECT)
        {
            sprite.Centered = false;
        }
        body.AddChild(sprite);

        float positionX = (float)(stadiumObject.ShapeStruct.Position.X);
        float positionY = (float)(stadiumObject.ShapeStruct.Position.Y);

        body.Position = new Godot.Vector2(positionX, positionY);

        if (stadiumObject.Shape == StadiumObject.Type.RECT)
        {
            body = loadRectBody(stadiumObject, body);
        }
        else
        {
            body = loadCircBody(stadiumObject, body);
        }


        AddChild(body);
    }
    void setCountry()
    {
        ImageTexture countryTexture = new ImageTexture();

        countryTexture.Load($"Resources/Graphics/Flags/{footballerData.Country}.png");
        country.Texture = countryTexture;
    }
Beispiel #4
0
    void initializeBackground()
    {
        ImageTexture texture = new ImageTexture();

        texture.Load(data.BackgroundTexturePath);
        background.Texture = texture;
    }
Beispiel #5
0
    void setCountry()
    {
        ImageTexture texture = new ImageTexture();

        texture.Load($"Resources/Graphics/Flags/{Team.TeamData.Country}.png");
        country.Texture = texture;
    }
    void updateFederationCountryFlag(string identifier)
    {
        ImageTexture texture = new ImageTexture();

        texture.Load($"Resources/Graphics/Flags/{identifier}.png");
        flag.Texture = texture;
    }
Beispiel #7
0
    void setKit(string teamShort)
    {
        ImageTexture texture = new ImageTexture();

        texture.Load($"Resources/Graphics/Teams/{teamShort}/kit.png");
        kit.Texture = texture;
    }
Beispiel #8
0
    void setCurrentModeLogo()
    {
        string       path    = $"Resources/Graphics/GUI/{ModeData.ModeToString(GameData.CurrentMode)}.png";
        ImageTexture texture = new ImageTexture();

        texture.Load(path);
        modeLogo.Texture = texture;
    }
Beispiel #9
0
    void setCountry(ValidCountries.Country validCountry)
    {
        string       countryCode = ValidCountries.CountryToString(validCountry);
        ImageTexture texture     = new ImageTexture();

        texture.Load($"Resources/Graphics/Flags/{countryCode}.png");
        country.Texture = texture;
    }
Beispiel #10
0
    void setKit()
    {
        ImageTexture texture = new ImageTexture();

        TeamData teamData = DBReader.GetTeamData(Data.FootballerData.TeamId);

        texture.Load($"Resources/Graphics/Teams/{teamData.Short}/kit.png");
        kit.Texture = texture;
    }
    void generateKit()
    {
        TeamData teamData = DBReader.GetTeamData(GameData.CurrentTeamDBId);

        ImageTexture texture = new ImageTexture();

        texture.Load($"Resources/Graphics/Teams/{teamData.Short}/kit.png");
        kit.Texture = texture;
    }
Beispiel #12
0
    void setPositionIcon(NativePositionsValueHandler.ValidPositions nativePosition)
    {
        string nativePositionId = NativePositionsValueHandler.ValidPositionsToString(nativePosition);

        ImageTexture texture = new ImageTexture();

        texture.Load($"Resources/Graphics/Positions/{nativePositionId}.png");
        position.Texture = texture;
    }
Beispiel #13
0
    ImageTexture prepareLogoTexture()
    {
        string logoPath = prepareLogoPath();

        ImageTexture logoTexture = new ImageTexture();

        logoTexture.Load(logoPath);

        return(logoTexture);
    }
Beispiel #14
0
    ImageTexture prepareItemTexture(string resourceIdentifier)
    {
        ImageTexture texture = new ImageTexture();

        string path = Data.PATH_TO_RES + "/" + Data.IMAGE_RES_ID + "/" + resourceIdentifier;

        path += Data.CurrentTurn == Data.Team.TEAM_1 ? Data.TEAM_1_RES_ID : Data.TEAM_2_RES_ID;
        path += ".png";
        texture.Load(path);

        return(texture);
    }
Beispiel #15
0
    void initializeKits()
    {
        ImageTexture team1Kit = new ImageTexture();

        team1Kit.Load($"Resources/Graphics/Teams/{GameData.CurrentTeam.TeamData.Short}/kit.png");
        kit1.Texture = team1Kit;

        ImageTexture team2Kit = new ImageTexture();

        team2Kit.Load($"Resources/Graphics/Teams/{GameData.CurrentOpponentTeam.TeamData.Short}/kit.png");
        kit2.Texture = team2Kit;
    }
Beispiel #16
0
    void initializeCountries()
    {
        ImageTexture team1Country = new ImageTexture();

        team1Country.Load($"Resources/Graphics/Flags/{GameData.CurrentTeam.TeamData.Country}.png");
        country1.Texture = team1Country;

        ImageTexture team2Country = new ImageTexture();

        team2Country.Load($"Resources/Graphics/Flags/{GameData.CurrentOpponentTeam.TeamData.Country}.png");
        country2.Texture = team2Country;
    }
Beispiel #17
0
    void initializeCountries(OnlineTeam team1, OnlineTeam team2)
    {
        ImageTexture team1Texture = new ImageTexture();

        team1Texture.Load($"Resources/Graphics/Flags/{team1.TeamData.Country}.png");
        Team1Country.Texture = team1Texture;

        ImageTexture team2Texture = new ImageTexture();

        team2Texture.Load($"Resources/Graphics/Flags/{team2.TeamData.Country}.png");
        Team2Country.Texture = team2Texture;
    }
    public void Initialize(TeamLeagueResultData.MatchResult[] results)
    {
        loadComponents();

        if (results.Length < matches.Count)
        {
            return; // cant happen but ok
        }
        for (int i = 0; i < matches.Count; i++)
        {
            ImageTexture texture = new ImageTexture();
            texture.Load($"Resources/Graphics/GUI/{resultToTextureName(results[i])}.png");
            matches[i].Texture = texture;
        }
    }
Beispiel #19
0
    void generateHalfRateDot(int rate)
    {
        ImageTexture halfDotTexture = new ImageTexture();

        halfDotTexture.Load("Resources/Graphics/GUI/rateDotHalf.png");

        Sprite sprite = new Sprite();

        sprite.Texture  = halfDotTexture;
        sprite.Centered = false;
        float xAxis = halfDotTexture.GetSize().x *((rate / 2)) + RATE_GAP * ((rate / 2));

        sprite.Position = new Vector2(xAxis, 0);

        AddChild(sprite);
    }
    void initializeEnduranceBar()
    {
        ImageTexture barElementTexture = new ImageTexture();

        barElementTexture.Load("Resources/Graphics/GUI/enduranceIndicator.png");

        for (int i = 0; i < ENDURANCE_BAR_MAX_LENGTH; i++)
        {
            int barElementX = i * (int)barElementTexture.GetSize().x;

            Sprite barElementSprite = new Sprite();
            barElementSprite.Texture  = barElementTexture;
            barElementSprite.Position = new Vector2(barElementX, 0);
            barElementSprite.Centered = false;
            enduranceBar.AddChild(barElementSprite);
        }
    }
    void fillVelocityBar(int barLength)
    {
        ImageTexture barElementTexture = new ImageTexture();

        barElementTexture.Load("Resources/Graphics/GUI/velocityIndicator.png");

        for (int i = 0; i < barLength; i++)
        {
            int barElementX = i * (int)barElementTexture.GetSize().x;

            Sprite barElementSprite = new Sprite();
            barElementSprite.Texture  = barElementTexture;
            barElementSprite.Position = new Vector2(barElementX, 0);
            barElementSprite.Centered = false;
            velocityBar.AddChild(barElementSprite);
        }
    }
Beispiel #22
0
    void generateFullRateDots(int rate)
    {
        ImageTexture fullDotTexture = new ImageTexture();

        fullDotTexture.Load("Resources/Graphics/GUI/rateDotFull.png");

        for (int i = 0; i < rate - 1; i += 2)
        {
            Sprite sprite = new Sprite();
            sprite.Texture  = fullDotTexture;
            sprite.Centered = false;
            float xAxis = fullDotTexture.GetSize().x *(i / 2) + RATE_GAP * (i / 2);
            sprite.Position = new Vector2(xAxis, 0);

            AddChild(sprite);
        }
    }
Beispiel #23
0
    StaticBody2D loadCircBody(StadiumObject stadiumObject, StaticBody2D body)
    {
        CollisionShape2D collider = new CollisionShape2D();

        CircleShape2D shape      = new CircleShape2D();
        CircStruct    circStruct = (CircStruct)stadiumObject.ShapeStruct;

        shape.Radius   = (float)circStruct.Size.X / 2;
        collider.Shape = shape;
        body.AddChild(collider);

        ImageTexture texture = new ImageTexture();

        texture.Load(stadiumObject.TexturePath);
        Sprite sprite = new Sprite();

        sprite.Texture = texture;
        body.AddChild(sprite);

        return(body);
    }
Beispiel #24
0
    void setKit()
    {
        ImageTexture texture = new ImageTexture();

        texture.Load($"Resources/Graphics/Teams/{Team.TeamData.Short}/kit.png");
    }