Make an infinite scrolling background of an Uneven image

Get help using Construct 2

Post » Fri Jan 08, 2016 9:25 am

Like in the Autorunner Template, there is the event :

Condition:
X <= - Self.Width / 2

Action:
Set X : Self.X + Self.Width / 2

But this only apply to images with the same width of their layout. Can anyone give an event for images not equal to the width of their layout? Thanks in advance XD
Image



The Things you can create is only limited by your imagination. If you don't have the skills then use your motivation as a natural force to exceed all expectations. Chadori RebornXD
B
51
S
17
G
90
Posts: 1,108
Reputation: 59,024

Post » Fri Jan 08, 2016 10:15 am

Could you share your capx to clarify your question?

For the above event to work, the image doen't have to be the same width as the layout..
It has to be at least as wide as the layout and repeated two times, because it only moves half it's width every time..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Fri Jan 08, 2016 3:06 pm

LittleStain wrote:Could you share your capx to clarify your question?

For the above event to work, the image doen't have to be the same width as the layout..
It has to be at least as wide as the layout and repeated two times, because it only moves half it's width every time..


Yeah that's true, but I already tried resizing the background by x2 or changing Self.Width / 2 with /1.909 or something that'll fit the size of the image and still something wrong..

I'll post the .capx in just a minute..
Last edited by chadorireborn on Fri Jan 08, 2016 3:19 pm, edited 1 time in total.
Image



The Things you can create is only limited by your imagination. If you don't have the skills then use your motivation as a natural force to exceed all expectations. Chadori RebornXD
B
51
S
17
G
90
Posts: 1,108
Reputation: 59,024

Post » Fri Jan 08, 2016 3:13 pm

LittleStain wrote:Could you share your capx to clarify your question?

For the above event to work, the image doen't have to be the same width as the layout..
It has to be at least as wide as the layout and repeated two times, because it only moves half it's width every time..


Here is the .capx file XD Hope you find the problem and do explain.

https://onedrive.live.com/redir?resid=A ... ile%2ccapx
Image



The Things you can create is only limited by your imagination. If you don't have the skills then use your motivation as a natural force to exceed all expectations. Chadori RebornXD
B
51
S
17
G
90
Posts: 1,108
Reputation: 59,024

Post » Fri Jan 08, 2016 3:17 pm

chadorireborn wrote:
LittleStain wrote:Could you share your capx to clarify your question?

For the above event to work, the image doen't have to be the same width as the layout..
It has to be at least as wide as the layout and repeated two times, because it only moves half it's width every time..


Yeah that's true, already tried to resizing the background by x2 or changing Self.Width / 2 with /1.909 or something that'll fit the size of the image..

I'll post the .capx in just a minute..


ehhmm..
I don't understand what you mean with 1.909..

self.width is the width of your object, so why would you have to change anything?
You'd still want to move the object half of it's width, right?

Waiting for the capx..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Fri Jan 08, 2016 3:23 pm

It will work if you set the width of your background to 3690px

To get the background to be at least the width of your project, it needs to be 3x615px(it's original image size)..
To make this code work, it has to be twice as wide, so 3690px
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Fri Jan 08, 2016 3:29 pm

LittleStain wrote:It will work if you set the width of your background to 3690px

To get the background to be at least the width of your project, it needs to be 3x615px(it's original image size)..
To make this code work, it has to be twice as wide, so 3690px


Wow! Great Thanks, Just another question. Does making your tiledbackground larger lowers the performance? Which is better? to resize my imagefile(the image of the tile) so that it can maintain 2560px or just leave the tiledbackground size to 3960px?
Image



The Things you can create is only limited by your imagination. If you don't have the skills then use your motivation as a natural force to exceed all expectations. Chadori RebornXD
B
51
S
17
G
90
Posts: 1,108
Reputation: 59,024

Post » Fri Jan 08, 2016 3:34 pm

chadorireborn wrote:
LittleStain wrote:It will work if you set the width of your background to 3690px

To get the background to be at least the width of your project, it needs to be 3x615px(it's original image size)..
To make this code work, it has to be twice as wide, so 3690px


Wow! Great Thanks, Just another question. Does making your tiledbackground larger lowers the performance? Which is better? to resize my imagefile(the image of the tile) so that it can maintain 2560px or just leave the tiledbackground size to 3960px?


Your image is 615x194..
That is the image size in memory..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Fri Jan 08, 2016 3:36 pm

LittleStain wrote:
chadorireborn wrote:
LittleStain wrote:It will work if you set the width of your background to 3690px

To get the background to be at least the width of your project, it needs to be 3x615px(it's original image size)..
To make this code work, it has to be twice as wide, so 3690px


Wow! Great Thanks, Just another question. Does making your tiledbackground larger lowers the performance? Which is better? to resize my imagefile(the image of the tile) so that it can maintain 2560px or just leave the tiledbackground size to 3960px?


Your image is 615x194..
That is the image size in memory..


So the (Ingame sprite or tiledbackground) size or instance count doesn't lower performance (cpu or ram) is that what you mean only the ImageFile?
Image



The Things you can create is only limited by your imagination. If you don't have the skills then use your motivation as a natural force to exceed all expectations. Chadori RebornXD
B
51
S
17
G
90
Posts: 1,108
Reputation: 59,024

Post » Fri Jan 08, 2016 3:42 pm

chadorireborn wrote:So the (Ingame sprite or tiledbackground) size or instance count doesn't lower performance (cpu or ram) is that what you mean only the ImageFile?


Not the file, just the image..
The size in the game effects the drawing, not the (image-)memory it occupies..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Next

Return to How do I....?

Who is online

Users browsing this forum: Iftikhar555, mohamed hagras, oddreal, RetroSpock and 3 guests