Ask here your questions to get help using GDevelop.
By scott_taylor
#45387 hi im new to this and trying to make a drag and drop building game but cant figure out how to make the screen scroll on a button press.

heres what im trying to do;
screen size of the game is 800x600 i have a floor 2000x2000 and want to use the arrow buttons to be able to scroll around the 2000x2000 area with the objects that have been placed on it to stay fixed in the same position (like scrolling round a map)

any help will be much appreciated
By Mats
#45389 Make an event like this:

Code: Select allConditions:
Key Down is pressed
Timer "movement" is great than 0.25 seconds

Actions:
Reset timer "movement"
Do +50 to the y position of camera


And another like this:

Code: Select allConditions:
Timer "movement" is greater than 0.25 seconds
Key Up is pressed

Actions:
Reset timer "movement"
Do + 50 to the y position of camera.


Then you will be able to scroll up and down (you might want to experiment with different values where I put 0.25 and +50). You can do a similar thing for camera x position.
By scott_taylor
#45391 Wow thanks that worked perfectly i must admit this program is slightly confusing me but im getting there :) and thanks for the speedy reply
By Glaydur
#45397
scott_taylor wrote:Wow thanks that worked perfectly i must admit this program is slightly confusing me but im getting there :) and thanks for the speedy reply


DW, if you don't understand anything, just ask here in the forum. But make sure you've read the tutorials and articles in the wiki and also searched first before making a new post. Good luck! :D
By Mats
#45414
scott_taylor wrote:Wow thanks that worked perfectly i must admit this program is slightly confusing me but im getting there :) and thanks for the speedy reply


If you ever have a problem, there is almost always someone on the forum who will offer you a decent solution. ;)
User avatar
By Darkhog
#45417
Mats wrote:If you ever have a problem, there is always someone on the forum who will offer you a decent solution. ;)

FTFY.
By scott_taylor
#45624 Now my game is coming together abit i want the scrolling to be smooth instead of it jumping 50px a time is there anyway i cn implement this into the current code or will i have to change how i go about it, also how do i set it so it only scrolls around my background without showing the white space? Iv looked around the forum but cnt seem to get close to what i want it to do
By scott_taylor
#45658 thanks iv got it sorted now