UIElement.SetOffsetVal (Civ5 API)

From Civilization Modding Wiki
Revision as of 14:25, 20 September 2012 by DonQuich (talk | contribs) (Bot update)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

This page is a part of the Lua and UI Reference (Civ5).


Function.png This method is declared by ControlBase.

This is an instance method, invoke it with a colon.


Usage

void UIElement:SetOffsetVal(int xOffset, int yOffset)


Parameters

xOffset: No description available.
yOffset: No description available.


Source code samples

Too many occurences. Only 50 out of 233 are listed.

ChooseReligionPopup.lua (G&K)

DLC/Expansion/UI/InGame/Popups/ChooseReligionPopup.lua
0383
Controls.FollowerBelief2Description:SetOffsetVal(24,25);
0388
Controls.EnhancerBeliefDescription:SetOffsetVal(24,25);
0407
Controls.FollowerBelief2Description:SetOffsetVal(52,30);
0412
Controls.EnhancerBeliefDescription:SetOffsetVal(52,30);
0440
Controls.BonusBeliefDescription:SetOffsetVal(24,25);
0452
Controls.BonusBeliefDescription:SetOffsetVal(52,30);


CityBannerManager.lua

UI/InGame/CityBannerManager.lua
0754
BannerInstance.CityName:SetOffsetVal(-3,0);


CityView.lua

UI/InGame/CityView/CityView.lua
1082
controlTable.SlackerButton:SetOffsetVal( (slackerAdded % numberOfSlackersPerRow) * slackerSize + slackerPadding, math.floor(slackerAdded / numberOfSlackersPerRow) * slackerSize + slackerPadding );


CivilopediaScreen.lua

UI/Civilopedia/CivilopediaScreen.lua
0115
Controls.ScrollBar:SetOffsetVal( 0, 18 );
0116
Controls.LeftScrollBar:SetOffsetVal( 0, 18 );
0117
Controls.DownButton:SetOffsetVal( 0, screenSizeY - 126 - 18 );
0118
Controls.LeftDownButton:SetOffsetVal( 0, screenSizeY - 126 - 18 );
0119
Controls.LeftUpButton:SetOffsetVal( 0, 0 );
0133
Controls.SelectedCategoryTab:SetOffsetVal(50 * (selectedCategory - 1), -10);
1806
button:SetOffsetVal( (buttonAdded % numberOfButtonsPerRow) * buttonSize + buttonPadding, math.floor(buttonAdded / numberOfButtonsPerRow) * buttonSize + buttonPadding );
2085
thisBuildingInstance.UnlockedBuildingButton:SetOffsetVal( (buttonAdded % numberOfButtonsPerRow) * buttonSize + buttonPadding, math.floor(buttonAdded / numberOfButtonsPerRow) * buttonSize + buttonPadding );
2943
thisBuildingInstance.RequiredBuildingButton:SetOffsetVal( (buttonAdded % numberOfButtonsPerRow) * buttonSize + buttonPadding, math.floor(buttonAdded / numberOfButtonsPerRow) * buttonSize + buttonPadding );
3550
thisBuildingInstance.UniqueBuildingButton:SetOffsetVal( (buttonAdded % numberOfButtonsPerRow) * buttonSize + buttonPadding, math.floor(buttonAdded / numberOfButtonsPerRow) * buttonSize + buttonPadding );
3581
thisImprovementInstance.UniqueImprovementButton:SetOffsetVal( (buttonAdded % numberOfButtonsPerRow) * buttonSize + buttonPadding, math.floor(buttonAdded / numberOfButtonsPerRow) * buttonSize + buttonPadding );


EnemyUnitPanel.lua

UI/InGame/WorldView/EnemyUnitPanel.lua
1705
Controls.MyDeltaBar:SetOffsetVal( 0, healthBarSize.y + 4 );
1707
Controls.MyDeltaBar:SetOffsetVal( 0, 2 );
1750
Controls.TheirDeltaBar:SetOffsetVal( 0, healthBarSize.y + 4 );
1752
Controls.TheirDeltaBar:SetOffsetVal( 0, 2 );


InstalledPanel.lua

UI/FrontEnd/Modding/InstalledPanel.lua
0735
Controls.DetailValuesStack:SetOffsetVal(details_size.x - max_detail_value_width, 0);
0737
Controls.DetailLabelsStack:SetOffsetVal(details_size.x - max_detail_value_width - spacer -  max_detail_label_width, 0);


MPGameSetupScreen.lua

UI/FrontEnd/Multiplayer/GameSetup/MPGameSetupScreen.lua
0162
Controls.OptionsScrollPanel:SetOffsetVal( 40, 44 );


NotificationPanel.lua

UI/InGame/WorldView/NotificationPanel.lua
0371
Controls.SmallScrollPanel:SetOffsetVal( 20, 0 );
0373
Controls.SmallScrollPanel:SetOffsetVal( 0, 0 );


ProductionPopup.lua

UI/InGame/Popups/ProductionPopup.lua
0035
Controls.ScrollBar:SetOffsetVal( 15, 18 );
0037
Controls.DownButton:SetOffsetVal( 15, screenSizeY - 414 );


SocialPolicyPopup.lua

UI/InGame/Popups/SocialPolicyPopup.lua
0703
pipe.ConnectorImage:SetOffsetVal( xOffset, (prereq.GridY-1)*g_PolicyPipeYOffset + 58 );
0712
pipe.ConnectorImage:SetOffsetVal( xOffset + 16, (prereq.GridY-1 + thisPipe.yOffset)*g_PolicyPipeYOffset + 58 );
0752
startPipe.ConnectorImage:SetOffsetVal( xOffset, (policy.GridY-1)*g_PolicyPipeYOffset + 48 );
0757
pipe.ConnectorImage:SetOffsetVal( xOffset, (policy.GridY-1)*g_PolicyPipeYOffset + 58 );
0760
pipe.ConnectorImage:SetOffsetVal( xOffset, (policy.GridY-1 + thisPipe.yOffset)*g_PolicyPipeYOffset + 58 );
0804
startPipe.ConnectorImage:SetOffsetVal( xOffset, (policy.GridY-1)*g_PolicyPipeYOffset + 0 );
0809
pipe.ConnectorImage:SetOffsetVal( xOffset, (policy.GridY-1)*g_PolicyPipeYOffset - 10 );
0886
controlTable.PolicyIcon:SetOffsetVal((policyInfo.GridX-1)*g_PolicyXOffset+16,(policyInfo.GridY-1)*g_PolicyYOffset+12);


TechTree.lua

UI/InGame/TechTree/TechTree.lua
0152
hConnection.TechPipeIcon:SetOffsetVal(prereq.GridX*blockSpacingX + blockSizeX + 96, (prereq.GridY-5)*blockSpacingY + 12 + extraYOffset);
0160
vConnection.TechPipeIcon:SetOffsetVal((tech.GridX-1)*blockSpacingX + blockSizeX + 96, ((tech.GridY-5)*blockSpacingY) - (((tech.GridY-prereq.GridY) * blockSpacingY) / 2) + extraYOffset);
0202
startPipe.TechPipeIcon:SetOffsetVal( tech.GridX*blockSpacingX + blockSizeX + 64, yOffset );
0208
pipe.TechPipeIcon:SetOffsetVal( (tech.GridX)*blockSpacingX + blockSizeX + 96, yOffset );
0211
pipe.TechPipeIcon:SetOffsetVal( (tech.GridX+thisPipe.xOffset)*blockSpacingX + blockSizeX + 96 - 12, yOffset - 15 );
0225
pipe.TechPipeIcon:SetOffsetVal( (tech.GridX+thisPipe.xOffset)*blockSpacingX + blockSizeX + 96 - 12, yOffset );
0235
pipe.TechPipeIcon:SetOffsetVal( (tech.GridX)*blockSpacingX + blockSizeX + 96 - 12, yOffset );
0269
startPipe.TechPipeIcon:SetOffsetVal( tech.GridX*blockSpacingX + 26, yOffset );
0275
pipe.TechPipeIcon:SetOffsetVal( (tech.GridX)*blockSpacingX, yOffset );
0278
pipe.TechPipeIcon:SetOffsetVal( (tech.GridX)*blockSpacingX, yOffset - 15);
0458
thisTechButtonInstance.TechButton:SetOffsetVal( tech.GridX*blockSpacingX + 64, (tech.GridY-5)*blockSpacingY + extraYOffset);


UnitPanel.lua

UI/InGame/WorldView/UnitPanel.lua
0225
instance.UnitActionButton:SetOffsetVal( (numBuildActions % numberOfButtonsPerRow) * buttonSize + buttonPadding + buttonOffsetX, math.floor(numBuildActions / numberOfButtonsPerRow) * buttonSize + buttonPadding + buttonOffsetY );



The initial version of this page was created by the Civ5 API Bot, see the Civ5 API Reference FAQ. Some of the texts come from the 2kgames' wiki and most of code samples are copyrighted to Firaxis.
Functions' signatures were either copied from the 2kgames' wiki, or infered from the Lua source files and the binaries. Errors are possible.
Contributors may find help in the Contributors guide to the Civ5 API.