- Home /
Duplicate Question
How do I "page" multiple images across a surface?
When a player “touches” (defined below), a surface, I want a set of images to begin paging across that surface and continue paging until the player “touches” that surface again. For example, a player would “touch” the “Weapons selection screen” on the bridge of the Starship. Then images of weapons would start paging across the screen. When the player saw the weapon they wanted to use, they would touch the screen again, the paging would stop and the “Weapons selection screen” would be filled with an image of that weapon. If the player then decided they didn’t like that weapon, they could “touch” the screen and start over. “Touch” may vary by platform, etc. so that on iOS it may be the player touching the screen to select the “Weapons selection screen” and on xBox, it may be the player directing their avatar to touch the “Weapons selection screen” or maybe the player clicks on the “Weapons selection screen”. Ideally, the weapon images would be individually accessible so that page order could be specified and/or changed by the player in real time. So the player could ask to see them page by alphabetically, or in some other order: cost, deadliness, nastiness, etc. And specify the paging speed. And have sound, clicking, etc., in time with the paging speed. What’s the best way to do that? Thanks.
I suggest, very simply have a number of "simple planes" with an image on each one.
Just move the whole gameObject, when touched.
You'll have to learn about raycasting - that's about all you'll need here!
also go to unityGE$$anonymous$$S.com for many excellent beginner tutorials on this and other topics
If (for some reason) you literally want to move a "texture" on a gameObject, you simply use the "offset" feature of the texture.
Simply put any object in a scene in your editor, and look at the INSPECTOR for the object. You will see the "offset" n the texture and you can literally scroll it easily right there (or achieve the same in code)
So that's how to get started
FYI personally I would just use "2dToolkit" or any similar tool, and do it as a trivial 2D sprite. That's just what I persnally do for "scrolling selector" type things. Hope it helps!
Follow this Question
Related Questions
Problems With NGUI on MAC 1 Answer
Need help finding why my onGUI() sliding image puzzle has errors! 1 Answer
load images into an array runtime. 0 Answers
Compine 4 sprites into one big image 0 Answers
Panel UI Organisation 0 Answers