public void AddLayer(Texture2D picture, float depth, float moveRate) { BackgroundLayer layer = new BackgroundLayer(); layer.picture = picture; layer.depth = depth; layer.moveRate = moveRate; layer.pictureSize.X = picture.Width; layer.pictureSize.Y = picture.Height; layerList.Add(layer); }
public int CompareDepth(BackgroundLayer layer1, BackgroundLayer layer2) { if (layer1.depth < layer2.depth) { return(1); } if (layer1.depth > layer2.depth) { return(-1); } if (layer1.depth == layer2.depth) { return(0); } return(0); }