[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 486: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 486: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 486: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 486: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 486: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 486: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 486: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 486: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 486: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 486: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 486: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 486: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 486: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 486: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 486: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 486: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 486: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 486: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 486: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 486: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 486: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 486: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 486: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 486: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 486: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 486: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 115: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 115: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4675: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3817)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4677: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3817)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4678: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3817)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4679: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3817)
PocketMatrix • View topic - Scrolling Background screens
This site is no longer active and is available for archival purposes only. Registration and login is disabled.

Scrolling Background screens


Scrolling Background screens

Postby bcj » Sep 23, 2009 @ 3:17pm

Hello..
i am new to EDGELIB. I am developing a game for Windows Mobile 6 sdk ....
in my game i have to scroll the background using tiles of images . can an yone help me in this topic...

please give me step by step procedure or some sample code to get this .

thanks in advance .
bcj
bcj
pm Member
 
Posts: 18
Joined: Sep 23, 2009 @ 12:53pm
Location: hyd


Postby edge » Sep 24, 2009 @ 10:16am

Hi,

The following approach could suit your needs:
- Use a tilesheet which could contain 256 tiles in 16 rows (in a 16x16 matrix)
- Create a large tilemap array which fits your game 'world'
- Add scrolling variables, xscroll and yscroll. For example, xscroll can be a value from '0' to 'mapwidth_pixels - screenwidth_pixels'
- When rendering, determine which tiles of your tilemap fit within the screen, then get the matching tile from your tilesheet and blit the image to the screen
EDGELIB: Cross-platform mobile development at your fingertips
http://www.edgelib.com
User avatar
edge
pm Member
 
Posts: 1180
Joined: Aug 22, 2005 @ 3:42pm
Location: The Netherlands


Scrolling Background screens

Postby bcj » Sep 30, 2009 @ 1:03pm

thanks for your reply .
because i am a new learner of EDGELIB, i don't know the way of working with tileArray,and setting the world properties .
can you give another easy way or some code help to scroll a singe image(not as tiles) cotinuously as background.

cheers
bcj
bcj
pm Member
 
Posts: 18
Joined: Sep 23, 2009 @ 12:53pm
Location: hyd


Postby edge » Oct 2, 2009 @ 7:45am

EDGELIB: Cross-platform mobile development at your fingertips
http://www.edgelib.com
User avatar
edge
pm Member
 
Posts: 1180
Joined: Aug 22, 2005 @ 3:42pm
Location: The Netherlands


Scrolling Background screens

Postby bcj » Oct 28, 2009 @ 6:59pm

Hai EDGE ,
thanks for your reply , i tried your code to get scrolling effect , but i can't get scrolling.

in my game i have 640x480 screen . and i have one background image of same size . so i have to scroll it on that screen.

please give me a simple way to scroll that image smoothly..

on that scrolling background , i have to move my sprite objects also . so give me the solution for that.

waiting for reply...
bcj
bcj
bcj
pm Member
 
Posts: 18
Joined: Sep 23, 2009 @ 12:53pm
Location: hyd


Postby edge » Oct 29, 2009 @ 9:41am

Hi,

If you need to scroll an image with the same size of the screen, you need to repeat that image horizontally or vertically (depending on your game).

To get more information on how to learn game programming techniques we recommend checking sites such as www.gamedev.net.
EDGELIB: Cross-platform mobile development at your fingertips
http://www.edgelib.com
User avatar
edge
pm Member
 
Posts: 1180
Joined: Aug 22, 2005 @ 3:42pm
Location: The Netherlands


Scrolling Background screens

Postby bcj » Nov 2, 2009 @ 8:02pm

hi...Edge
Thanks for your response ..
i tried to get scrolling background..but i didn't get it correctly.

so can you please help me in this issue...and give me some solution , that how to get scrolling effect of background.

my game having 640x480 size , and have one image.
we can use image repeatively and can get scrolling..
can you give me solution in this way...
or your suggested way of solution.

if possible give me some example code of repeating the image Horizontally and vertically.

Waiting for reply... Thanks in Advance
bcj
bcj
pm Member
 
Posts: 18
Joined: Sep 23, 2009 @ 12:53pm
Location: hyd


Postby edge » Nov 5, 2009 @ 9:32am

EDGELIB: Cross-platform mobile development at your fingertips
http://www.edgelib.com
User avatar
edge
pm Member
 
Posts: 1180
Joined: Aug 22, 2005 @ 3:42pm
Location: The Netherlands


Return to EDGELIB


Sort


Forum Description

Powerful and affordable C++ middleware solution covering true multi-platform 2D, 3D and network features for Apple iPhone, Windows Mobile, Symbian S60, UIQ, Linux and Windows desktop.

Moderator:

edge

Forum permissions

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

cron