Skip to content

Basic Red Triangle#256

Merged
omckeon merged 11 commits intothoth-tech:usage-examplesfrom
huyhuynh2319:Simple-Red-Triangle-Usage-Example
Dec 2, 2024
Merged

Basic Red Triangle#256
omckeon merged 11 commits intothoth-tech:usage-examplesfrom
huyhuynh2319:Simple-Red-Triangle-Usage-Example

Conversation

@huyhuynh2319
Copy link

@huyhuynh2319 huyhuynh2319 commented Nov 18, 2024

Describe the example and what it demonstrates.
The code demonstrates the use of Basic_Red_Triangle

Splashkit Function: Basic_Red_Triangle

Files Included

  • C# code (Object-Oriented Programming)
  • Python code

Usage Example Checks

  • Simple, clear demonstration of the function
  • Code uses Splashkit functions
  • Tested in Chrome and Firefox

@netlify
Copy link

netlify bot commented Nov 18, 2024

Deploy Preview for splashkit-io ready!

Name Link
🔨 Latest commit f7ff8e0
🔍 Latest deploy log https://app.netlify.com/sites/splashkit-io/deploys/6743df6d2f00690008038308
😎 Deploy Preview https://deploy-preview-256--splashkit-io.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@huyhuynh2319 huyhuynh2319 changed the title add draw_triangle_on_window Nov 18, 2024
Copy link

@breezy-codes breezy-codes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not quite sure on whats happened here. This planner card was for doing -
https://splashkit.io/usage-examples/graphics/#simple-red-triangle

This is just to update the existing usage example by adding the missing files.

@huyhuynh2319 huyhuynh2319 changed the title draw_triangle_on_window Basic Red Triangle Nov 24, 2024
Comment on lines +2 to +22
public class SimpleRedTriangle
{
public static void Main()
{
new SimpleRedTriangle().Run();
}
public void Run()
{
Window _window = new Window("Simple Red Triangle", 800, 600);

while (!_window.CloseRequested)
{
SplashKit.ProcessEvents();
_window.Clear(Color.White);
SplashKit.FillTriangle(Color.Red, 150, 50, 250, 250, 50, 250);
_window.Refresh();
}
}

}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please review the guide on how to convert from top level to OOP. There should be minimal change to the actual code.

https://thoth-tech.netlify.app/products/splashkit/splashkit-website/tutorials-documentation/04-oop-styling/

Then correct the code.

Comment on lines +12 to +18
while (!_window.CloseRequested)
{
SplashKit.ProcessEvents();
_window.Clear(Color.White);
SplashKit.FillTriangle(Color.Red, 150, 50, 250, 250, 50, 250);
_window.Refresh();
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also remove the while close not requested, this is not found in the other versions of this code.

Copy link

@breezy-codes breezy-codes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've left several requests for changes.
In addition these files are incorrectly named, meaning they don't actually come up on the site.
Please ensure you are actually following the documentation on how to do usage examples.

https://thoth-tech.netlify.app/products/splashkit/splashkit-website/usage-examples/01-overview/

@huyhuynh2319 huyhuynh2319 changed the base branch from main to usage-examples November 25, 2024 02:51
@huyhuynh2319
Copy link
Author

I did update all the code. Thanks for your feedback.

Copy link

@breezy-codes breezy-codes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You also need to update the existing c sharp file to be named correctly as said in the documentation I keep referring to.

image

Please also ensure you are running npm run build and previewing this site yourself on your local machine before pushing the changes.

@netlify
Copy link

netlify bot commented Nov 25, 2024

Deploy Preview for splashkit-usage-examples ready!

Name Link
🔨 Latest commit 71a0896
🔍 Latest deploy log https://app.netlify.com/sites/splashkit-usage-examples/deploys/674da4ec9549c300085c41f3
😎 Deploy Preview https://deploy-preview-256--splashkit-usage-examples.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

@breezy-codes breezy-codes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code is now correct, structured correctly and free of errors.
I approve this PR.

@omckeon omckeon self-assigned this Dec 2, 2024
Copy link

@omckeon omckeon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make sure to use the same Window name to ensure consistency

@omckeon omckeon merged commit 66e3d1d into thoth-tech:usage-examples Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants