Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / How do I scroll a texture?

Author
Message
Image All
18
Years of Service
User Offline
Joined: 30th Dec 2005
Location: Home
Posted: 6th Jan 2006 19:45
I'm having a bit of trouble trying to scroll my Pong puck's texture o_O

I've already tried this


It's not scrolling 0no
How can I make this work?

TKsFox
18
Years of Service
User Offline
Joined: 25th Nov 2005
Location: No no no - Its not the Cyberspace
Posted: 6th Jan 2006 19:54
Me happened the same. A good value as speed is 0.003 or maybe 0.03 i cant remember

128 is to fast

try this one:



It's me...
Image All
18
Years of Service
User Offline
Joined: 30th Dec 2005
Location: Home
Posted: 6th Jan 2006 20:31
It's still not working O.o

TKsFox
18
Years of Service
User Offline
Joined: 25th Nov 2005
Location: No no no - Its not the Cyberspace
Posted: 6th Jan 2006 20:45
Would be nice if u can upload the object + texture

It's me...
Image All
18
Years of Service
User Offline
Joined: 30th Dec 2005
Location: Home
Posted: 6th Jan 2006 20:51
It's a ball 10 units large

here's the texture


Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 6th Jan 2006 22:08
I think it won't work because it's too subtle of a change. If this is the ball for pong there is really no need to scroll the texture at all because the ball can be rotated while in motion... the only bad thing is it's hard to rotate right without outside dll's.

Use the arrow keys in this code snip:



Image All
18
Years of Service
User Offline
Joined: 30th Dec 2005
Location: Home
Posted: 6th Jan 2006 23:10 Edited at: 7th Jan 2006 00:02
Quote: "the ball can be rotated while in motion"


O.o ... I never looked at it that way

I added the XROTATE command to the game loop and it didn't mess it up one bit.



Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 7th Jan 2006 00:56
Also the scroll texture value is a float from 0.0 to 1.0 (0.0 and 1.0 do the same thing) you should wrap your values to that.

can't test this but should be something like this.

PTS#=1.0
...
DO
...
DEC PTS#, 0.001
IF PTS#<0.0 THEN PTS#=1.0
SCROLL OBJECT TEXTURE PUK,0,PTS#
...
LOOP

Login to post a reply

Server time is: 2024-09-24 13:24:12
Your offset time is: 2024-09-24 13:24:12