void setCountry(string countryCode) { ImageTexture texture = new ImageTexture(); texture.Load($"Resources/Graphics/Flags/{countryCode}.png"); country.Texture = texture; }
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; }
void initializeBackground() { ImageTexture texture = new ImageTexture(); texture.Load(data.BackgroundTexturePath); background.Texture = texture; }
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; }
void setKit(string teamShort) { ImageTexture texture = new ImageTexture(); texture.Load($"Resources/Graphics/Teams/{teamShort}/kit.png"); kit.Texture = texture; }
void setCurrentModeLogo() { string path = $"Resources/Graphics/GUI/{ModeData.ModeToString(GameData.CurrentMode)}.png"; ImageTexture texture = new ImageTexture(); texture.Load(path); modeLogo.Texture = texture; }
void setCountry(ValidCountries.Country validCountry) { string countryCode = ValidCountries.CountryToString(validCountry); ImageTexture texture = new ImageTexture(); texture.Load($"Resources/Graphics/Flags/{countryCode}.png"); country.Texture = texture; }
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; }
void setPositionIcon(NativePositionsValueHandler.ValidPositions nativePosition) { string nativePositionId = NativePositionsValueHandler.ValidPositionsToString(nativePosition); ImageTexture texture = new ImageTexture(); texture.Load($"Resources/Graphics/Positions/{nativePositionId}.png"); position.Texture = texture; }
ImageTexture prepareLogoTexture() { string logoPath = prepareLogoPath(); ImageTexture logoTexture = new ImageTexture(); logoTexture.Load(logoPath); return(logoTexture); }
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); }
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; }
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; }
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; } }
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); } }
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); } }
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); }
void setKit() { ImageTexture texture = new ImageTexture(); texture.Load($"Resources/Graphics/Teams/{Team.TeamData.Short}/kit.png"); }