-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
5 Usage example for Graphics P3 #345
base: usage-examples
Are you sure you want to change the base?
5 Usage example for Graphics P3 #345
Conversation
✅ Deploy Preview for splashkit-usage-examples ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi! I have reviewed this pull request and suggest changes. Mostly with font, comments and spacing inconsistencies that apply to all the display functions programs. The draw pixel program is making the program go unresponsive when I tested it so I have suggested some changes there to help avoid the overload.
|
||
// Write display details to the console | ||
|
||
SplashKit.DrawText($" Name: {display.Name}", Color.Black, "Arial", 24, 100, 100); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Font is different from the cpp and py files. I suggest loading a font.
} | ||
// Keep the window open for 5 seconds | ||
SplashKit.RefreshScreen(); | ||
SplashKit.Delay(3000); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inconsistent delay with the other files and doesn't match the comment.
SplashKit.RefreshScreen(); | ||
SplashKit.Delay(3000); | ||
|
||
SplashKit.CloseAllWindows(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Close window is called twice.
@@ -0,0 +1,17 @@ | |||
from splashkit import * |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest putting more spacing between the lines so that it is consistent with the other files and looks more organised.
// Loop through all displays and print their details | ||
for (int i = 0; i < number_of_displays(); i++) | ||
{ | ||
display disp = display_details(i); // Get the details of the display |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comments are different from the others.
// Loop through all displays and print their height | ||
for (int i = 0; i < number_of_displays(); i++) | ||
{ | ||
display disp = display_details(i); // Get the height of the display |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Different loop comments.
// Draw 100 random pixels on the window | ||
for (int i = 0; i < 100; i++) | ||
{ | ||
draw_pixel_on_window(COLOR_GRAY, rnd(800), rnd(600)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Error in parameters. There should be a window parameter as well.
|
||
} | ||
// Close all windows | ||
close_all_windows; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing '()' for function.
open_window("Falling Snow", 800, 600); | ||
|
||
// Loop until the user requests to quit | ||
while (!quit_requested()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This caused the program to go unresponsive. I suggest removing this while loop and increase the number of pixels.
Description
This is a usage example of the function display details, name, width, height and draw pixel on window.
Splashkit Function:
display_details
display_name
display_width
display_height
draw_pixel_on_window
Testing Checklist
Usage Example Checks