TCOD

 view release on metacpan or  search on metacpan

lib/TCOD/Sys.pod  view on Meta::CPAN


    ( $w, $h ) = TCOD::Sys::get_char_size;

You can get the size in pixels of the characters in the font.

=head2 get_current_resolution

    ( $w, $h ) = TCOD::Sys::get_current_resolution;

You can get the current screen resolution with
L<get_current_resolution|/get_current_resolution>.

You can use it for example to get the desktop resolution before initialising
the root console.

=head2 force_fullscreen_resolution

    TCOD::Sys::force_fullscreen_resolution( $width, $height );

This function allows you to force the use of a specific resolution in
fullscreen mode. The default resolution depends on the root console size
and the font character size.

=head2 get_directory_contents

    @filenames = TCOD::Sys::get_directory_contents( $path );

Returns a list of the contents of a directory (including files and
subdirectories), not including C<.> and C<..>. Will die with an error message
if the operation fails.

This function is implemented here for compatibility. Standard Perl solutions
are probably preferable.

=head2 wait_for_event

    # Deprecated
    TCOD::Sys::wait_for_event( $mask, \$key, \$mouse, $flush );

This function waits for an event from the user. The C<$mask> shows what
events we're waiting for. The return value indicate what event was actually
triggered. Values in key and mouse structures are updated accordingly.

If flush is false, the function waits only if there are no pending events,
else it returns the first event in the buffer.

This function is deprecated. Use C<SDL_WaitEvent> from SDL instead.

=head2 check_for_event

    # Deprecated
    $event = TCOD::Sys::check_for_event( $mask, \$key, \$mouse );

This function checks if an event from the user is in the buffer. The
C<$mask> shows what events we're waiting for. The return value indicates what
event was actually found. Values in key and mouse structures are updated
accordingly.

This function is deprecated. Use C<SDL_PollEvent> from SDL instead.

=head2 clipboard_set

    # Deprecated
    $bool = TCOD::Sys::clipboard_set( $contents );

Takes UTF-8 text and copies it into the system clipboard. On Linux, because
an application cannot access the system clipboard unless a window is open,
if no window is open the call will do nothing.

This function is deprecated. Use SDL2 to handle the clipboard.

=head2 clipboard_get

    # Deprecated
    $contents = TCOD::Sys::clipboard_get;

Returns the UTF-8 text currently in the system clipboard. On Linux, because
an application cannot access the system clipboard unless a window is open,
if no window is open an empty string will be returned.

This function is deprecated. Use SDL2 to handle the clipboard.

=head1 SEE ALSO

=over

=item L<TCOD>

=item L<TCOD::Console>

=item L<TCOD::Key>

=item L<TCOD::Mouse>

=back

=head1 COPYRIGHT AND LICENSE

Copyright 2021 José Joaquín Atria

This library is free software; you can redistribute it and/or modify it under
the Artistic License 2.0.



( run in 1.171 second using v1.01-cache-2.11-cpan-2398b32b56e )