1
Window / Stopping View Scrolling
« on: September 07, 2011, 04:50:20 am »
:oops:
I'm to new at this to give you actual code, however I would break it down as so:
I'm to new at this to give you actual code, however I would break it down as so:
Code: [Select]
psodo
ViewPort (x, y, width, height)
bool leftA = false; //left side active?
bool rightA = true; //right side active?
Change(ViewPort);
if ViewPort.x <= 0
{
ViewPort.x = 0;
leftA = false;
}
else
{
leftA = true;
}
if ViewPort.x >= picture.width-ViewPort.width
{
ViewPort.x = picture.width-ViewPort.width;
rightA = false;
}
else
{
rightA = true;
}
void Change(ViewPort)
{
(I said move it left)
{
if rightA = true move it
else do nothing.
}
(I said move it right)
{
if leftA = true move it
else do nothing.
}
}
/* of course above code won't work in any current language,
but should give an idea in what ways you might like to go*/