this commit message was generated automatically
This commit is contained in:
parent
81ac5e636b
commit
e15047829c
BIN
.vs/SheetPlayer/v15/.suo
Normal file
BIN
.vs/SheetPlayer/v15/.suo
Normal file
Binary file not shown.
0
.vs/SheetPlayer/v15/Server/sqlite3/db.lock
Normal file
0
.vs/SheetPlayer/v15/Server/sqlite3/db.lock
Normal file
BIN
.vs/SheetPlayer/v15/Server/sqlite3/storage.ide
Normal file
BIN
.vs/SheetPlayer/v15/Server/sqlite3/storage.ide
Normal file
Binary file not shown.
BIN
.vs/SheetPlayer/v15/Server/sqlite3/storage.ide-shm
Normal file
BIN
.vs/SheetPlayer/v15/Server/sqlite3/storage.ide-shm
Normal file
Binary file not shown.
BIN
.vs/SheetPlayer/v15/Server/sqlite3/storage.ide-wal
Normal file
BIN
.vs/SheetPlayer/v15/Server/sqlite3/storage.ide-wal
Normal file
Binary file not shown.
@ -51,19 +51,19 @@
|
||||
<Compile Include="aoMenu.Designer.cs">
|
||||
<DependentUpon>aoMenu.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Form1.cs">
|
||||
<Compile Include="mainForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Form1.Designer.cs">
|
||||
<DependentUpon>Form1.cs</DependentUpon>
|
||||
<Compile Include="mainForm.Designer.cs">
|
||||
<DependentUpon>mainForm.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<EmbeddedResource Include="aoMenu.resx">
|
||||
<DependentUpon>aoMenu.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Form1.resx">
|
||||
<DependentUpon>Form1.cs</DependentUpon>
|
||||
<EmbeddedResource Include="mainForm.resx">
|
||||
<DependentUpon>mainForm.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
|
@ -21,7 +21,10 @@ namespace SheetPlayer {
|
||||
|
||||
public Rectangle currentFrame {
|
||||
get {
|
||||
return animationFrames[mainForm.globalFrameCounter % animationFrames.Count];
|
||||
if (animationFrames.Count != 0)
|
||||
return animationFrames[mainForm.globalFrameCounter % animationFrames.Count];
|
||||
else
|
||||
return new Rectangle(0, 0, 48, 48);
|
||||
}
|
||||
}
|
||||
|
||||
@ -49,15 +52,44 @@ namespace SheetPlayer {
|
||||
catch { }
|
||||
}
|
||||
|
||||
public void updateMetaData() {
|
||||
animationFrames.Add(new Rectangle(0, 0, 48, 48));
|
||||
animationFrames.Add(new Rectangle(48, 0, 48, 48));
|
||||
animationFrames.Add(new Rectangle(96, 0, 48, 48));
|
||||
animationFrames.Add(new Rectangle(96, 0, 48, 48));
|
||||
animationFrames.Add(new Rectangle(144, 0, 48, 48));
|
||||
foreach (char c in metaData.ToCharArray(0, metaData.Length)) {
|
||||
|
||||
public bool updateMetaData() {
|
||||
try {
|
||||
animationFrames.Clear();
|
||||
string[] headerAndBody = metaData.Split('f');
|
||||
string[] header = headerAndBody[0].Split('x');
|
||||
int width = Convert.ToInt32(header[0]);
|
||||
int height = header.Length > 1 ? Convert.ToInt32(header[1]) : Convert.ToInt32(header[0]);
|
||||
int hFrames = spriteSheet.Width / width;
|
||||
int vFrames = spriteSheet.Height / height;
|
||||
string[] frameList = headerAndBody[1].Split('.');
|
||||
foreach (string frame in frameList) {
|
||||
string[] range = frame.Split(':');
|
||||
if (range.Length == 1) {
|
||||
int frameNumber = Convert.ToInt32(frame);
|
||||
animationFrames.Add(new Rectangle(
|
||||
frameNumber % hFrames * width,
|
||||
frameNumber / hFrames * height,
|
||||
width, height));
|
||||
}
|
||||
else {
|
||||
int rangeBegin = Convert.ToInt32(range[0]);
|
||||
int rangeEnd = Convert.ToInt32(range[1]);
|
||||
for (int frameNumber = rangeBegin;
|
||||
frameNumber <= Math.Max(rangeBegin, rangeEnd) &&
|
||||
frameNumber >= Math.Min(rangeBegin, rangeEnd);
|
||||
frameNumber += rangeEnd > rangeBegin ? 1 : -1) {
|
||||
animationFrames.Add(new Rectangle(
|
||||
frameNumber % hFrames * width,
|
||||
frameNumber / hFrames * height,
|
||||
width, height));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace SheetPlayer {
|
||||
@ -14,6 +15,7 @@ namespace SheetPlayer {
|
||||
|
||||
private void tbMetaData_TextChanged(object sender, EventArgs e) {
|
||||
mainForm.aoPool[index].metaData = tbMetaData.Text;
|
||||
tbMetaData.BackColor = mainForm.aoPool[index].updateMetaData() ? Color.White : Color.Tomato;
|
||||
}
|
||||
|
||||
private void tbSize_Scroll(object sender, EventArgs e) {
|
||||
|
Binary file not shown.
Binary file not shown.
@ -145,13 +145,16 @@ namespace SheetPlayer {
|
||||
drawLocations.Add(obj.position);
|
||||
}
|
||||
foreach (Point pos in drawLocations) {
|
||||
g.SetClip(new Rectangle(pos,
|
||||
g.SetClip(new Rectangle(obj.size == 1 ? pos : new Point((int)(pos.X - obj.size * 0.5),
|
||||
(int)(pos.Y - obj.size * 0.5)),
|
||||
new Size(obj.currentFrame.Size.Width * obj.size,
|
||||
obj.currentFrame.Size.Height * obj.size)),
|
||||
CombineMode.Replace);
|
||||
g.DrawImage(obj.spriteSheet, pos.X - obj.currentFrame.X * obj.size,
|
||||
pos.Y - obj.currentFrame.Y * obj.size,
|
||||
obj.spriteSheet.Size.Width * obj.size, obj.spriteSheet.Size.Height * obj.size);
|
||||
g.DrawImage(obj.spriteSheet,
|
||||
pos.X - obj.currentFrame.X * obj.size,
|
||||
pos.Y - obj.currentFrame.Y * obj.size,
|
||||
obj.spriteSheet.Size.Width * obj.size,
|
||||
obj.spriteSheet.Size.Height * obj.size);
|
||||
}
|
||||
}
|
||||
}
|
Binary file not shown.
@ -0,0 +1 @@
|
||||
d5b1bdcd24e43524c6aef8fe84793665622bd1ba
|
@ -8,3 +8,14 @@ C:\Users\Dave\Desktop\Projects\SheetPlayer\SheetPlayer\obj\Debug\SheetPlayer.csp
|
||||
C:\Users\Dave\Desktop\Projects\SheetPlayer\SheetPlayer\obj\Debug\SheetPlayer.exe
|
||||
C:\Users\Dave\Desktop\Projects\SheetPlayer\SheetPlayer\obj\Debug\SheetPlayer.pdb
|
||||
C:\Users\Dave\Desktop\Projects\SheetPlayer\SheetPlayer\obj\Debug\SheetPlayer.aoMenu.resources
|
||||
C:\Users\Dave\Desktop\Projects\ol'\SheetPlayerProject\SheetPlayer\bin\Debug\SheetPlayer.exe.config
|
||||
C:\Users\Dave\Desktop\Projects\ol'\SheetPlayerProject\SheetPlayer\bin\Debug\SheetPlayer.exe
|
||||
C:\Users\Dave\Desktop\Projects\ol'\SheetPlayerProject\SheetPlayer\bin\Debug\SheetPlayer.pdb
|
||||
C:\Users\Dave\Desktop\Projects\ol'\SheetPlayerProject\SheetPlayer\obj\Debug\SheetPlayer.csprojAssemblyReference.cache
|
||||
C:\Users\Dave\Desktop\Projects\ol'\SheetPlayerProject\SheetPlayer\obj\Debug\SheetPlayer.aoMenu.resources
|
||||
C:\Users\Dave\Desktop\Projects\ol'\SheetPlayerProject\SheetPlayer\obj\Debug\SheetPlayer.mainForm.resources
|
||||
C:\Users\Dave\Desktop\Projects\ol'\SheetPlayerProject\SheetPlayer\obj\Debug\SheetPlayer.Properties.Resources.resources
|
||||
C:\Users\Dave\Desktop\Projects\ol'\SheetPlayerProject\SheetPlayer\obj\Debug\SheetPlayer.csproj.GenerateResource.cache
|
||||
C:\Users\Dave\Desktop\Projects\ol'\SheetPlayerProject\SheetPlayer\obj\Debug\SheetPlayer.csproj.CoreCompileInputs.cache
|
||||
C:\Users\Dave\Desktop\Projects\ol'\SheetPlayerProject\SheetPlayer\obj\Debug\SheetPlayer.exe
|
||||
C:\Users\Dave\Desktop\Projects\ol'\SheetPlayerProject\SheetPlayer\obj\Debug\SheetPlayer.pdb
|
||||
|
Binary file not shown.
BIN
SheetPlayer/obj/Debug/SheetPlayer.csprojAssemblyReference.cache
Normal file
BIN
SheetPlayer/obj/Debug/SheetPlayer.csprojAssemblyReference.cache
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue
Block a user