mirror of
https://github.com/danbulant/Cosmos
synced 2026-05-19 20:39:01 +00:00
Added DrawFilledRectangle and example in CGS demo
This commit is contained in:
parent
cb2fd84416
commit
804e112e55
4 changed files with 8 additions and 44 deletions
|
|
@ -68,26 +68,6 @@
|
|||
<Compile Remove="*" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\source\Cosmos.Core.Plugs.Asm\Cosmos.Core.Plugs.Asm.csproj">
|
||||
<Name>Cosmos.Core.Plugs.Asm</Name>
|
||||
<Project>{3c186d37-21c3-417c-95f1-19be538af88a}</Project>
|
||||
<Private>True</Private>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\source\Cosmos.Core.Plugs\Cosmos.Core.Plugs.csproj">
|
||||
<Name>Cosmos.Core.Plugs</Name>
|
||||
<Project>{1132e689-18b0-4d87-94e8-934d4802c540}</Project>
|
||||
<Private>True</Private>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\source\Cosmos.Debug.Kernel.Plugs.Asm\Cosmos.Debug.Kernel.Plugs.Asm.csproj">
|
||||
<Name>Cosmos.Debug.Kernel.Plugs.Asm</Name>
|
||||
<Project>{7e450662-b34c-49b0-a826-f45ad3a18891}</Project>
|
||||
<Private>True</Private>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\source\Cosmos.System.Plugs\Cosmos.System.Plugs.csproj">
|
||||
<Name>Cosmos.System.Plugs</Name>
|
||||
<Project>{9431ff1f-ad75-4a1e-b38a-46e0f109411d}</Project>
|
||||
<Private>True</Private>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\CosmosGraphicSubsystem\CosmosGraphicSubsystem.csproj">
|
||||
<Name>CosmosGraphicSubsystem</Name>
|
||||
<Project>{49f2c01d-d2c5-4564-810b-1ae92236c5c1}</Project>
|
||||
|
|
@ -95,4 +75,4 @@
|
|||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(AppData)\Cosmos User Kit\Build\VSIP\Cosmos.targets" />
|
||||
</Project>
|
||||
</Project>
|
||||
|
|
@ -70,6 +70,10 @@ namespace Cosmos_Graphic_Subsytem
|
|||
pen.Color = Color.LimeGreen;
|
||||
canvas.DrawRectangle(pen, 450, 450, 80, 60);
|
||||
|
||||
/* A filled rectange */
|
||||
pen.Color = Color.Chocolate;
|
||||
canvas.DrawFilledRectangle(pen, 200, 150, 400, 300);
|
||||
|
||||
/*
|
||||
* It will be really beautiful to do here:
|
||||
* canvas.DrawString(pen, "Please press any key to end the Demo...");
|
||||
|
|
|
|||
|
|
@ -3,20 +3,6 @@ cls
|
|||
|
||||
set NuGet=Build\Tools\nuget.exe
|
||||
set VSWhere=Build\Tools\vswhere.exe
|
||||
set IL2CPU=..\IL2CPU\IL2CPU.sln
|
||||
set XS=..\XSharp\XSharp.sln
|
||||
|
||||
echo Finding XSharp repo directory
|
||||
IF EXIST %XS% (echo XSharp solution found!) else (
|
||||
echo XSharp not found!
|
||||
goto NOI2CXS
|
||||
)
|
||||
|
||||
echo Looking for IL2CPU repo directory...
|
||||
IF EXIST %IL2CPU% (echo IL2CPU solution found!) else (
|
||||
echo IL2CPU not found!
|
||||
goto NOI2CXS )
|
||||
|
||||
|
||||
:NuGet
|
||||
echo Running NuGet restore
|
||||
|
|
@ -38,9 +24,4 @@ if exist %MSBuild% (
|
|||
)
|
||||
|
||||
|
||||
start "Cosmos Builder" "source\Cosmos.Build.Builder\bin\Debug\Cosmos.Build.Builder.exe" "-VSPATH=%InstallDir%" %1 %2 %3 %4 %5 %6 %7 %8 %9
|
||||
|
||||
|
||||
:NOI2CXS
|
||||
echo install-vs2017.bat failed to find the required IL2CPU or XSharp directories
|
||||
echo Be sure to see the Cosmos documentation for instructions on building Cosmos
|
||||
start "Cosmos Builder" "source\Cosmos.Build.Builder\bin\Debug\Cosmos.Build.Builder.exe" "-VSPATH=%InstallDir%" %1 %2 %3 %4 %5 %6 %7 %8 %9
|
||||
|
|
@ -325,10 +325,9 @@ namespace Cosmos.System.Graphics
|
|||
|
||||
public virtual void DrawFilledRectangle(Pen pen, int x_start, int y_start, int width, int height)
|
||||
{
|
||||
for (int i = 0; i != width; i++)
|
||||
for (int y = y_start; y < y_start + height; y++)
|
||||
{
|
||||
DrawLine(pen, x_start, y_start, x_start + height, y_start);
|
||||
y_start++;
|
||||
DrawLine(pen, x_start, y, x_start + width - 1, y);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue