pico-sdl
Loading...
Searching...
No Matches
State

All getters and setters. More...

Functions

Pico_Anchor pico_get_anchor_draw (void)
 Gets the origin used to draw objects (center, topleft, etc).
Pico_Anchor pico_get_anchor_rotate (void)
 Gets the origin used to rotate objects (center, topleft, etc).
Pico_Color pico_get_color_clear (void)
 Gets the color set to clear the screen.
Pico_Color pico_get_color_draw (void)
 Gets the color set to draw.
Pico_Rect pico_get_crop (void)
 Gets the cropping applied to objects when drawing them.
Pico_Pos pico_get_cursor (void)
 Gets the position of the text cursor.
int pico_get_expert (void)
 Gets the state of expert mode.
Pico_Flip pico_get_flip (void)
 Gets the flipping state of objects.
const char * pico_get_font (void)
 Gets the font used to draw texts.
int pico_get_grid (void)
 Gets the state of the logical pixel grid.
int pico_get_rotate (void)
 Gets the rotation angle of objects (in degrees).
Pico_Pct pico_get_scale (void)
 Gets the scaling factor of objects (percentage).
Pico_Pos pico_get_scroll (void)
 Gets the point of view on the logical window.
Pico_Size pico_get_size (void)
 Gets the physical and logical window size.
Pico_Dim pico_get_size_image (const char *file)
 Gets the size of the given image.
Pico_Dim pico_get_size_text (const char *text)
 Gets the size of the given text.
int pico_get_show (void)
 Gets the visibility state of the window.
PICO_STYLE pico_get_style (void)
 Gets the drawing style.
Uint32 pico_get_ticks (void)
 Gets the amount of ticks that passed since pico was initialized.
const char * pico_get_title (void)
 Gets the aplication title.
Pico_Pct pico_get_zoom (void)
 Gets the scaling factor of the screen view (percentage).
void pico_set_anchor_draw (Pico_Anchor anchor)
 Changes the reference to draw objects (center, topleft, etc).
void pico_set_anchor_rotate (Pico_Anchor anchor)
 Changes the reference to rotate objects (center, topleft, etc).
void pico_set_color_clear (Pico_Color color)
 Changes the color used to clear the screen.
void pico_set_color_draw (Pico_Color color)
 Changes the color used to draw objects.
void pico_set_crop (Pico_Rect crop)
 Changes the cropping that is applied to images before drawing them.
void pico_set_cursor (Pico_Pos pos)
 Sets the position of the text cursor.
void pico_set_expert (int on)
 Toggles the expert mode.
void pico_set_flip (Pico_Flip flip)
 Sets the flipping state of objects.
void pico_set_font (const char *file, int h)
 Changes the font used to draw texts.
void pico_set_grid (int on)
 Toggles a grid on top of logical pixels.
void pico_set_rotate (int angle)
 Sets the rotation angle of objects (in degrees).
void pico_set_scale (Pico_Pct scale)
 Sets the scaling factor of objects.
void pico_set_scroll (Pico_Pos pos)
 Sets the point of view on the logical window.
void pico_set_size (Pico_Dim phy, Pico_Dim log)
 Sets the physical and logical window sizes.
void pico_set_show (int on)
 Toggles the aplication window visibility.
void pico_set_style (PICO_STYLE style)
 Sets the drawing style.
void pico_set_title (const char *title)
 Sets the aplication title.
void pico_set_zoom (Pico_Pct zoom)
 Sets the scaling factor of the screen view.

Detailed Description

All getters and setters.

Function Documentation

◆ pico_get_anchor_draw()

Pico_Anchor pico_get_anchor_draw ( void )

Gets the origin used to draw objects (center, topleft, etc).

See also
pico_get_anchor_rotate

◆ pico_get_anchor_rotate()

Pico_Anchor pico_get_anchor_rotate ( void )

Gets the origin used to rotate objects (center, topleft, etc).

See also
pico_get_anchor_draw

◆ pico_get_color_clear()

Pico_Color pico_get_color_clear ( void )

Gets the color set to clear the screen.

◆ pico_get_color_draw()

Pico_Color pico_get_color_draw ( void )

Gets the color set to draw.

◆ pico_get_crop()

Pico_Rect pico_get_crop ( void )

Gets the cropping applied to objects when drawing them.

◆ pico_get_cursor()

Pico_Pos pico_get_cursor ( void )

Gets the position of the text cursor.

See also
pico_output_write
pico_output_writeln

◆ pico_get_expert()

int pico_get_expert ( void )

Gets the state of expert mode.

◆ pico_get_flip()

Pico_Flip pico_get_flip ( void )

Gets the flipping state of objects.

◆ pico_get_font()

const char * pico_get_font ( void )

Gets the font used to draw texts.

◆ pico_get_grid()

int pico_get_grid ( void )

Gets the state of the logical pixel grid.

◆ pico_get_rotate()

int pico_get_rotate ( void )

Gets the rotation angle of objects (in degrees).

◆ pico_get_scale()

Pico_Pct pico_get_scale ( void )

Gets the scaling factor of objects (percentage).

◆ pico_get_scroll()

Pico_Pos pico_get_scroll ( void )

Gets the point of view on the logical window.

◆ pico_get_show()

int pico_get_show ( void )

Gets the visibility state of the window.

◆ pico_get_size()

Pico_Size pico_get_size ( void )

Gets the physical and logical window size.

◆ pico_get_size_image()

Pico_Dim pico_get_size_image ( const char * file)

Gets the size of the given image.

Parameters
fileimage filepath

◆ pico_get_size_text()

Pico_Dim pico_get_size_text ( const char * text)

Gets the size of the given text.

Parameters
texttext to measure

◆ pico_get_style()

PICO_STYLE pico_get_style ( void )

Gets the drawing style.

◆ pico_get_ticks()

Uint32 pico_get_ticks ( void )

Gets the amount of ticks that passed since pico was initialized.

Examples
event_loop.c.

◆ pico_get_title()

const char * pico_get_title ( void )

Gets the aplication title.

◆ pico_get_zoom()

Pico_Pct pico_get_zoom ( void )

Gets the scaling factor of the screen view (percentage).

◆ pico_set_anchor_draw()

void pico_set_anchor_draw ( Pico_Anchor anchor)

Changes the reference to draw objects (center, topleft, etc).

// file: init.c
#include <pico.h>
int main() {
// ...
SDL_Rect r = {10, 10, 20, 20};
pico_set_anchor(PICO_TOP, PICO_LEFT);
pico_output_draw_rect(r); // (r.x, r.y) is the top-left of r
pico_set_anchor(PICO_CENTER, PICO_MIDDLE);
pico_output_draw_rect(r); // (r.x, r.y) is the center of r
pico_set_anchor(PICO_BOTTOM, PICO_RIGHT);
pico_output_draw_rect(r); // (r.x, r.y) is the bottom-right of r
// ...
return 0;
}
void pico_init(int on)
Initializes and terminates pico.
void pico_output_draw_rect(Pico_Rect rect)
Draws a rectangle.
#define PICO_BOTTOM
Definition pico.h:42
#define PICO_CENTER
Definition pico.h:38
#define PICO_RIGHT
Definition pico.h:39
#define PICO_MIDDLE
Definition pico.h:41
#define PICO_LEFT
Definition pico.h:37
#define PICO_TOP
Definition pico.h:40
Parameters
anchoranchor for the x and y axis

◆ pico_set_anchor_rotate()

void pico_set_anchor_rotate ( Pico_Anchor anchor)

Changes the reference to rotate objects (center, topleft, etc).

// file: init.c
#include <pico.h>
int main() {
// ...
SDL_Rect r = {10, 10, 20, 20};
pico_set_anchor(PICO_TOP, PICO_LEFT);
pico_output_draw_rect(r); // (r.x, r.y) is the top-left of r
pico_set_anchor(PICO_CENTER, PICO_MIDDLE);
pico_output_draw_rect(r); // (r.x, r.y) is the center of r
pico_set_anchor(PICO_BOTTOM, PICO_RIGHT);
pico_output_draw_rect(r); // (r.x, r.y) is the bottom-right of r
// ...
return 0;
}
Parameters
anchoranchor for the x and y axis

◆ pico_set_color_clear()

void pico_set_color_clear ( Pico_Color color)

Changes the color used to clear the screen.

Parameters
colornew color

◆ pico_set_color_draw()

void pico_set_color_draw ( Pico_Color color)

Changes the color used to draw objects.

Parameters
colornew color

◆ pico_set_crop()

void pico_set_crop ( Pico_Rect crop)

Changes the cropping that is applied to images before drawing them.

Parameters
cropcropping region, which may have 0 area to disable cropping

◆ pico_set_cursor()

void pico_set_cursor ( Pico_Pos pos)

Sets the position of the text cursor.

Parameters
posnew cursor position
See also
pico_output_write
pico_output_writeln

◆ pico_set_expert()

void pico_set_expert ( int on)

Toggles the expert mode.

Parameters
on1 to enable it, or 0 to disable it

◆ pico_set_flip()

void pico_set_flip ( Pico_Flip flip)

Sets the flipping state of objects.

◆ pico_set_font()

void pico_set_font ( const char * file,
int h )

Changes the font used to draw texts.

Parameters
filepath to font file
hsize of the font

◆ pico_set_grid()

void pico_set_grid ( int on)

Toggles a grid on top of logical pixels.

Parameters
on1 to show it, or 0 to hide it

◆ pico_set_rotate()

void pico_set_rotate ( int angle)

Sets the rotation angle of objects (in degrees).

◆ pico_set_scale()

void pico_set_scale ( Pico_Pct scale)

Sets the scaling factor of objects.

Parameters
scalenew scaling for x and y axis (percentage)

◆ pico_set_scroll()

void pico_set_scroll ( Pico_Pos pos)

Sets the point of view on the logical window.

Parameters
posnew point of view

◆ pico_set_show()

void pico_set_show ( int on)

Toggles the aplication window visibility.

Parameters
on1 to show, or 0 to hide

◆ pico_set_size()

void pico_set_size ( Pico_Dim phy,
Pico_Dim log )

Sets the physical and logical window sizes.

Parameters
phynew physical size
lognew logical size

◆ pico_set_style()

void pico_set_style ( PICO_STYLE style)

Sets the drawing style.

Parameters
stylenew style

◆ pico_set_title()

void pico_set_title ( const char * title)

Sets the aplication title.

Parameters
titlenew title

◆ pico_set_zoom()

void pico_set_zoom ( Pico_Pct zoom)

Sets the scaling factor of the screen view.

Parameters
zoomnew scaling for x and y axis (percentage)