Jump to content

scroll rectangle/image


Recommended Posts

Posted

Hey, can somebody explain me how to scscroll it, as i understand i need to make just a part visible but how to make that?

(Sorry for asking this again)

"El conocimiento jamás debe detenerse, por que es lo único que nos salvará cuando no nos quede más".

Att: -|TG|-Mister[Q]<.

Posted

On scroll up i should use

offset = offset + --what i want to increment no?

But if get outs from a window, make it dissapear? (Last ddude)

"El conocimiento jamás debe detenerse, por que es lo único que nos salvará cuando no nos quede más".

Att: -|TG|-Mister[Q]<.

Posted

Don't mind my terrible photoshop :P But this might help you figure out how to work the offsets;

FxFJ2GF.png

As for if it goes outside of a window and you want it to disappear, I believe you'll have to use dxCreateRenderTarget.

If I help you in a thread and you need further assistance, please don't PM me - use the thread you created instead. This way everyone on the forum can take advantage of it.

Posted

So should create a render target, and draw the image/rectangle over it?

Can you make me an example with it?

"El conocimiento jamás debe detenerse, por que es lo único que nos salvará cuando no nos quede más".

Att: -|TG|-Mister[Q]<.

Posted

Try it yourself first and I'll help you from there. You'll learn the most by trying yourself and reading the examples provided on the wiki.

If I help you in a thread and you need further assistance, please don't PM me - use the thread you created instead. This way everyone on the forum can take advantage of it.

Posted

Scroll, successfull :D!

Dissapear when leave rectangle, fail....

The code:

  
local x, y = guiGetScreenSize() 
local myRenderTarget = dxCreateRenderTarget(732, 628, true) 
local offset = 0 
  
  
  
function lobby() 
  
dxDrawText("Fast Fucking War Multi-Room", 7, 9, 372, 55, tocolor(255, 158, 0, 255), 2.00, "default-bold", "center", "center", false, false, false, false, false) 
  
    if myRenderTarget then   
        ---Start using render target.... 
        dxSetRenderTarget( myRenderTarget ) ---Start drawing on it. 
        dxDrawRectangle((x - 732) / 2, (y - 628) / 2, 732, 628, tocolor(0, 0, 0, 168), false) 
        dxSetRenderTarget() --Stop Drawing on it. 
     
        --//Draw inner background... 
        dxDrawImage(0, 0, x, y, ":guieditor/images/bg.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) 
        --//Render target, suposes when images get out from here, will dissapear 
        dxDrawImage(146, 70, 732, 628, myRenderTarget, 0, 0, 0, tocolor(255, 255, 255, 255), false) 
         
        --//Draw the rest of it. 
        dxDrawImage(230, 80+offset, 564, 95, ":guieditor/images/deathmatch.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) 
        dxDrawImage(230, 200+offset, 564, 95, ":guieditor/images/oldschool.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) 
        dxDrawImage(230, 320+offset, 564, 95, ":guieditor/images/derby.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) 
        dxDrawImage(230, 440+offset, 564, 95, ":guieditor/images/hunter.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) 
        dxDrawImage(230, 560+offset, 564, 95, ":guieditor/images/shooter.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) 
         
         
--//Scrolling bar....        
        dxDrawRectangle(878, 70, 22, 530, tocolor(68, 68, 68, 255), false) 
         
         
    end  
end 
addEventHandler("onClientRender", root, lobby) 
  
  
function scrollUP() 
offset = offset - 20 
end 
  
function scrollDOWN() 
offset = offset + 20 
end 
bindKey("mouse_wheel_up","down",scrollUP) 
bindKey("mouse_wheel_down","down",scrollDOWN) 

"El conocimiento jamás debe detenerse, por que es lo único que nos salvará cuando no nos quede más".

Att: -|TG|-Mister[Q]<.

Posted

Bug, it works the images dont get out of rectangle, it looks horrible at top, it looks like duplicated .-.

"El conocimiento jamás debe detenerse, por que es lo único que nos salvará cuando no nos quede más".

Att: -|TG|-Mister[Q]<.

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...