playMaker

Author Topic: Move a map by grabbing it [SOLVED]  (Read 2348 times)

blackant

  • Hero Member
  • *****
  • Posts: 521
  • http://blackantmaster.com
    • blackantmaster.com
Move a map by grabbing it [SOLVED]
« on: February 11, 2014, 03:18:04 PM »
Hello,

i'm making a 2D game, using NGUI,
 in wich you may grab the map to move it zoom on it.
i fund a way to zoom it and restrict the size
but for the moving part, i'm not satisfacted, with my system, cause it refere to the whole screen size and not the game size... the while i  move my mouse is not on the same spot than the map.

and secondly i would like to constraint it to be always visible.
and when user stop using it, it must return to border position when zoomed, and centered when whole map is visible.

maybe i can use NGUI scroll view but i don't understand how to set it.

here is a little video of the game

« Last Edit: February 14, 2014, 04:22:47 PM by blackant »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Move a map by grabbing it
« Reply #1 on: February 12, 2014, 03:26:15 AM »
Hi,

 I would also study ngui scrollview. Ask on their forum for a working system. I guess you don't need any logic just finding the right ngui setup.

bye,

 Jean

blackant

  • Hero Member
  • *****
  • Posts: 521
  • http://blackantmaster.com
    • blackantmaster.com
Re: Move a map by grabbing it
« Reply #2 on: February 12, 2014, 02:52:04 PM »
ok thx i'll do

blackant

  • Hero Member
  • *****
  • Posts: 521
  • http://blackantmaster.com
    • blackantmaster.com
Re: Move a map by grabbing it
« Reply #3 on: February 14, 2014, 04:22:30 PM »
works pretty nice using NGUI ScrollWiew

you can see how it works following this tutorial.