Vortigem Posted May 24, 2013 Author Share Posted May 24, 2013 This is an unsupported CS:DE based source(DX8), and a learning experience for me.In ModConstants:```Public Const EqTop As Long = 68Public Const EqLeft As Long = 18Public Const EqOffsetX As Long = 25Public Const EqColumns As Long = 4```The above says that I have 4 Columns of equipment (Weapons, Chest, Helm, Shield) and they are 25 apart from each other on the X plane.I'm changing the equipment to display vertically so did the following:```Public Const EqTop As Long = 68Public Const EqLeft As Long = 18Public Const EqOffsetX As Long = 132Public Const EqColumns As Long = 2```Now I have 2 columns and they are spaced 132 apart, this is great however I believe the images of equipment are now displayed on top of each other and I'm trying to Offset them by Y. Any ideas? Link to comment Share on other sites More sharing options...
Zeno Posted May 24, 2013 Share Posted May 24, 2013 Hi Vortigem,I ran into this exact problem. You need to add in EqOffsetY as a variable, and add it into the y calculation line. Here's what I used.```y = GUIWindow(GUI_CHARACTER).y + EqTop + EqOffsetY*Int((I-1)/EqColumn)```Since int always rounds down, this will place the first EqColumn number of items in the first row, then the next EqColumn number in the next row, and so on. Without the -1 you'd only get EqColumn-1 on the first row, since the last one wouldn't be inclusive (e.g. 1/2 would return 0, but 2/2 would return 1) Link to comment Share on other sites More sharing options...
Vortigem Posted May 24, 2013 Author Share Posted May 24, 2013 Thanks Zeno!! I appreciate the explanation that came along with it! For everyone in the future, using Zeno's guidance from above I changed the following to make this work:Change in _Sub DrawEquipment_```Y = GUIWindow(GUI_CHARACTER).Y + EqTop + EqOffsetY * Int((I - 1) / EqColumns)```Change in _Function IsEqItem_```.Top = GUIWindow(GUI_CHARACTER).Y + EqTop + EqOffsetY * Int((I - 1) / EqColumns)```Add to _Character consts_:```Public Const EqOffsetY As Long = 25``` Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now