Update content repo for CLYDE 2.0.
This commit is contained in:
@@ -43,23 +43,25 @@ namespace Content.Client.Parallax
|
||||
}
|
||||
}
|
||||
|
||||
protected override void Draw(DrawingHandle handle)
|
||||
protected override void Draw(DrawingHandleBase handle)
|
||||
{
|
||||
if (_parallaxTexture == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var screenHandle = (DrawingHandleScreen) handle;
|
||||
|
||||
var (sizeX, sizeY) = _parallaxTexture.Size;
|
||||
var (posX, posY) = _eyeManager.ScreenToWorld(Vector2.Zero).ToWorld(_mapManager).Position;
|
||||
var (ox, oy) = (Vector2i) new Vector2(-posX / Slowness, posY / Slowness);
|
||||
ox = MathHelper.Mod(ox, sizeX);
|
||||
oy = MathHelper.Mod(oy, sizeY);
|
||||
|
||||
handle.DrawTexture(_parallaxTexture, new Vector2(ox, oy));
|
||||
handle.DrawTexture(_parallaxTexture, new Vector2(ox - sizeX, oy));
|
||||
handle.DrawTexture(_parallaxTexture, new Vector2(ox, oy - sizeY));
|
||||
handle.DrawTexture(_parallaxTexture, new Vector2(ox - sizeX, oy - sizeY));
|
||||
screenHandle.DrawTexture(_parallaxTexture, new Vector2(ox, oy));
|
||||
screenHandle.DrawTexture(_parallaxTexture, new Vector2(ox - sizeX, oy));
|
||||
screenHandle.DrawTexture(_parallaxTexture, new Vector2(ox, oy - sizeY));
|
||||
screenHandle.DrawTexture(_parallaxTexture, new Vector2(ox - sizeX, oy - sizeY));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user