本文整理汇总了C#中System.Drawing.Rect.useTexture方法的典型用法代码示例。如果您正苦于以下问题:C# Rect.useTexture方法的具体用法?C# Rect.useTexture怎么用?C# Rect.useTexture使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Drawing.Rect
的用法示例。
在下文中一共展示了Rect.useTexture方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnLoad
// Rect test;
public override void OnLoad(EventArgs e)
{
Game.stopMedia = false;
base.OnLoad(e);
// AviManager am = new AviManager("vid1.avi", true);
// VideoStream vs = am.GetVideoStream();
// test = new Rect(new Rectangle(0, 0, 300, 300), FrameGrabber.GetFrameFromVideo("vid1.avi", .2));
//vs.GetFrameOpen();
//vs.GetBitmap()
// Console.WriteLine(vs.StreamInfo.dwLength);
// vs.GetFrameClose();
Animation preload = new Animation(new Rectangle(0, 0, 0, 0), 100, "holdBurst", 3, true, true);
// ircl = new Client.irc.IrcClient("lol");
logo = new Rect(new Rectangle(Config.ResWidth / 2 - (710 / 2), 20, 710, 519), "skin\\Pulse-LogoText.png");
startText = new Label(game, new Rectangle(new Point(0, 0),
new Size(0, 0)), "pulse alpha version " + Config.Version);
SizeF temp = startText.TextTexture.getStringSize();
Button optionsButton = new Button(game, new Rectangle((Config.ResWidth / 2) - 150, 768 / 2 + 240, 300, 60), "Options", delegate(int data)
{
// new Thread(new ThreadStart(openOptions)).Start();
new Options().ShowDialog();
}, true, true, Color.LawnGreen);
Button exitButton = new Button(game, new Rectangle((Config.ResWidth / 2) - 150, 768 / 2 + 305, 300, 60), "Exit", delegate(int data)
{
game.Exit();
}, true, true, Color.Cyan);
Button playButton = new Button(game, new Rectangle(Config.ResWidth / 2 - 150, 768 / 2 + 110, 300, 60), "Play", delegate(int data)
{
play(true);
}, true, true, Color.Red);
Button editButton = new Button(game, new Rectangle(Config.ResWidth / 2 - 150, 768 / 2 + 175, 300, 60), "Edit", delegate(int data)
{
play(false);
}, true, true, Color.Blue);
avatarbutton = new Button(game, new Rectangle(Utils.getMX(700), 0, 300, 100), "\tLogin", delegate(int data)
{
new Pulse.UI.LoginDialog().ShowDialog();
// downloadAvatar();
});
UIComponents.Add(avatarbutton);
startText.TextTexture.Location = new Point(Config.ResWidth / 2 - ((int)temp.Width / 2), 0);
startText.TextTexture.TextureSize = new Size((int)temp.Width, (int)temp.Height);
bg = new Rect(new Rectangle(0, 0, Config.ResWidth, 768));
bg.Colour = new OpenTK.Graphics.Color4(0.4f, 0.4f, 0.4f, 1.0f);
bg.useTexture("skin\\Pulse-LogoText.png");
bg2 = new Rect(new Rectangle(0, 0, Config.ResWidth, 768));
bg2.Colour = new OpenTK.Graphics.Color4(0.4f, 0.4f, 0.4f, 1.0f);
bg2.useTexture("skin\\Pulse-LogoText.png");
bg2.Alpha = 0.3f;
bg3 = new Rect(new Rectangle(0, 0, Config.ResWidth, 768));
bg3.Colour = new OpenTK.Graphics.Color4(1.0f, 1.0f, 1.0f, 1.0f);
bg3.useTexture("skin\\Pulse-MenuBG.png");
bg4 = new Rect(new Rectangle(0, 0, Config.ResWidth, 768));
bg4.Colour = new OpenTK.Graphics.Color4(1.0f, 1.0f, 1.0f, 1.0f);
bg4.useTexture("skin\\Pulse-MenuOverlay.png");
website = new Button(game, new Rectangle(0, 768 - 53, 360, 53), "", delegate(int data)
{
if (!Game.pbox.expanded)
{
System.Diagnostics.Process.Start("http://p.ulse.net");
}
}, Skin.skindict["websiteText"]);
setMarquee();
UIComponents.Add(startText);
UIComponents.Add(optionsButton);
UIComponents.Add(playButton);
UIComponents.Add(editButton);
//UIComponents.Add(nowp);
UIComponents.Add(exitButton);
// pbox = new PTextBox(game, new Rectangle(0, 768-300, Utils.getMX(1024), 290), "", ircl);
//UIComponents.Add(pbox);
//UIComponents.Add(skipForwardButton);
//UIComponents.Add(togglePauseButton);
Game.conn.recvPacket += new Action<short, Client.RecievePacket>(conn_recvPacket);
//downloadAvatar();
}
示例2: OnLoad
//.........这里部分代码省略.........
difficultyTexts[3].Shadow = true;*/
#endregion
refresh();
index = 0;
for (int x = 0; x < songNameList.Count; x++)
{
if (songNameList[x].Info.SongName.Equals(Game.M.CurrentSong.SongName) && songNameList[x].Info.Dir.Equals(Game.M.CurrentSong.Dir))
{
index = x;
}
}
changeSong();
selectionTexture = new Rect(new Rectangle(2, 250, 548, 28));
sel2 = new Rect(new Rectangle(0, 249, 552, 30));
searchBox = new Rect(new Rectangle(0, 700, Config.ResWidth, 30));
searchBox.Colour = new OpenTK.Graphics.Color4(0.27f, 0.509f, 0.705f, .8f);
cover = new Rect(new Rectangle(Config.ResWidth - 300, 0, 300, 768));
cover.Colour = new OpenTK.Graphics.Color4(1f, 1f, 1f, .7f);
scorebg = new Rect(new Rectangle((int)(Config.ResWidth - 324), 180, 295, 600), Skin.skindict["scoreback"]);
sel2.Colour = new OpenTK.Graphics.Color4(0.0f, 0.0f, 0.0f, 1.0f);
selectionTexture.Colour = new OpenTK.Graphics.Color4(0.25f, 0.0f, 1.0f, 1.0f);
background = new Rect(new Rectangle(0, 0, Config.ResWidth, 768));
currentSong = SongLibrary.loadSong(songNameList[index].Info);
string bgString = "";
if (currentSong.FileVersion == 0)
{
bgString = currentSong.BgName;
}
else
{
bgString = currentSong.Charts[0].BgName;
}
background.useTexture("songs\\" + currentSong.Dir + "\\" + bgString);
music = AudioManager.loadFromFile("songs\\" + currentSong.Dir + "\\" + currentSong.FileName);
Music.Volume = 0.0f;
targetVolume = Config.Volume / 100.0f;
changed = true;
Music.PositionAsMilli = (long)Game.M.Music.PositionAsMilli;
Music.play(false, true);
if (play)
{
game.Title = "Pulse | Play Selection";
newSongb.Enabled = false;
newSongb.Visible = false;
help.Enabled = false;
help.Visible = false;
}
else
{
game.Title = "Pulse | Edit Selection";
newSongb.Enabled = true;
newSongb.Visible = true;
}
updateDiffs();
updateScoreLabels(0);
// changeSong();
// index = 0;
for (int x = 0; x < songNameList.Count; x++)
{
// if (songNameList[x].textData.Location.Y != 246 + ((x - index) * 33) && !songNameList[x].textData.Moving)
// {
songNameList[x].select.Bounds = new Rectangle(0, 246 + ((x - index) * 90), songNameList[x].select.Bounds.Width, songNameList[x].select.Bounds.Height);
// Console.WriteLine(songNameList[x].textData.Position.
//
示例3: initUI
private void initUI()
{
if (skip != null)
{
UIComponents.Remove(skip);
}
skip = new Button(game, new Rectangle(400, 350, 200, 50), "Skip", delegate(int data)
{
running = true;
unpause();
music.PositionAsMilli = (long)startOffset - 2000;
currentOffset = music.PositionAsMilli;
skip.Visible = false;
skip.Enabled = false;
});
UIComponents.Add(skip);
if (startOffset < 2000)
{
skip.Visible = false;
skip.Enabled = false;
}
else
{
skip.Visible = true;
skip.Enabled = true;
}
bg = new Rect(new Rectangle(0, 0, Config.ResWidth, 768));
if (currentSong.FileVersion == 0)
{
bg.useTexture("songs\\" + currentSong.Dir + "\\" + currentSong.BgName);
music = AudioManager.loadFromFile("songs\\" + currentSong.Dir + "\\" + currentSong.FileName);
}
else
{
bg.useTexture("songs\\" + currentSong.Dir + "\\" + chart.BgName);
music = AudioManager.loadFromFile("songs\\" + currentSong.Dir + "\\" + currentSong.FileName); //fix in future to load per chart
}
forceScores = false;
failed = false;
scores = false;
running = false;
paused = false;
UIComponents.Clear();
score = new Score();
score.Flags = (int)mods.Flags;
scoreFadeTime = 0;
pulse = false;
Config.Editing = false;
Skin.PlayFrame = new Frame(Skin.FrameLoc, chart.Keys);
frame = Skin.PlayFrame;
setNoteOffsets(Skin.FrameLoc);
tlContainer = new Rect(new Rectangle(Config.ResWidth - 605, 0, 605, 150), Skin.skindict["tlContainer"]);
hpBar = new Rect(new Rectangle((int)frame.Location.X + (int)frame.Width, 0, 10, (int)frame.HitHeight));
adjustHp(0);
overlay = new Rect(new Rectangle(0, 0, Config.ResWidth, 768));
overlay.Colour = new Color4(0.0f, 0.0f, 0.0f, 0.0f);
glow = new Rect(new Rectangle((int)frame.Location.X, (int)frame.HitHeight - 43, (int)frame.Width, 40), Skin.skindict["keyLight"]);
glow.Colour = Skin.PulseColour;
for (int x = 0; x < lights.Length; x++)
{
presses[x] = new Rect(new Rectangle(frame.Location.X + frame.LaneLoc[x] + 5 + (1 * x), frame.Location.Y + 600, frame.LaneWidth[x] + 1, 50), Skin.skindict["press" + (x + 1)]);
presses[x].fade(0.0f, 0.075);
lights[x] = new Rect(new Rectangle(((frame.Location.X) + frame.LaneLoc[x]) + (1 * x) + 5 + 25, (int)frame.HitHeight - 53, 0, frame.LaneWidth[x]), Skin.skindict["keyLight"]);
glows[x] = new Rect(new Rectangle(((frame.Location.X) + frame.LaneLoc[x]) + (1 * x) + 5, (int)frame.HitHeight - 203, frame.LaneWidth[x], 200), Skin.skindict["keyLight"]);
glows[x].Colour = new Color4(1.0f, 1.0f, 1.0f, 0.5f);
lights[x].Colour = Skin.LightColours[x];
lights[x].fade(0.0f, 0.075);
glows[x].fade(0.0f, 0.075);
}
songtitle = new Label(game, new Point(Config.ResWidth - 490, 10), currentSong.SongName + " - " + chart.Name);
songartist = new Label(game, new Point(Config.ResWidth - 485, 60), currentSong.Artist);
songtitle.TextTexture.TextFont = new Font("Myriad Pro", 35);
songtitle.TextTexture.Shadow = false;
songartist.TextTexture.Shadow = false;
UIComponents.Add(songartist);
UIComponents.Add(songtitle);
if (calibrate)
{
offsetLabel = new Label(game, new Point(450, 85), "Average mistime: ");
UIComponents.Add(offsetLabel);
offsetLabel.Visible = true;
offsetLabel.Enabled = true;
offsets.Clear();
}
scoreLabel = new GraphicalText(score.TotalScore.ToString("D9"), Skin.ScoreLocation);
scoreLabel.scale(new Size(30, 30), 0.1);
comboText = new GraphicalText("0x", (new Point(frame.Location.X + (int)frame.Width / 2 - (int)(GraphicalText.measureString("0x", frame.LaneWidth[0])) / 2, frame.Location.Y + 200)));
comboText.Visible = false;
accuracyLabel = new GraphicalText("00.00%", Skin.AccLocation);
pauseScreen = new PauseScreen(game, "pause", this);
pauseScreen.OnLoad(null);
countDown = new Label(game, new Point((int)frame.Location.X + (int)frame.Width + 20, (int)frame.HitHeight - 20), "00:00");
countDown.TextTexture.TextFont = new Font("Myriad pro", 30);
UIComponents.Add(countDown);
scoreLabel.scale(new Size(Skin.ScoreSize.Width, Skin.ScoreSize.Height), 0.0);
accuracyLabel.scale(new Size(Skin.AccSize.Width, Skin.AccSize.Height), 0.0);
if (skip != null)
{
UIComponents.Add(skip);
}
//.........这里部分代码省略.........