Jump to content

[HELP] DX SCROLL


itHyperoX

Recommended Posts

Hi!

I'm trying to calculate the position for a scrolling bar. I tried so many way, but i just failed. After wasted 2 hours for nothing, can anybody help me please ?


If needed, i'll post the code.

I  have a bg and i want the scrolling bar working with that.

local screenSize = {guiGetScreenSize()}
local panelW, panelH = 500, 300
local panelX, panelY = screenSize[1]/2-panelW/2, screenSize[2]/2-panelH/2


maxDraw = 5

--currentRow is when scrolling.  Thats + 1 or -1

dxDrawRectangle(panelX - 40, panelY, 10, panelH, tocolor(0, 0, 0, 220)) -- BG
dxDrawRectangle(panelX - 40, panelY + currentRow * maxDraw / #weaponTable, 10, 40, tocolor(0, 200, 0, 190))

 

Edited by TheMOG
Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...