Sponsored Content
Operating Systems Linux Android Basic Android platform information. Post 302851171 by Neo on Saturday 7th of September 2013 08:45:49 AM
Old 09-07-2013
Fantastic!

I look forward to your tutorial on this for everyone.

Who knows, maybe you will inspire others here to become Android programmers and they will create a nice app...

Don't let anyone discourage you, please.

Go for your dreams... never stop learning ... enjoy the fact you are motivated to do it
 

5 More Discussions You Might Find Interesting

1. UNIX Desktop Questions & Answers

Basic information please.

Good day all. I was glad to find this site. I am not new to computing as I have been in the field sense 1986 but my experience has almost all been with Windows systems. I garbed a book and managed to get a UNIX box running FreeBSD for my mail server and I'm serving 3 web sites off of two Win-98... (2 Replies)
Discussion started by: Sleeper =RG=
2 Replies

2. Android

Android is Linux (and Java)

In case you did not know, Android 2.1, Éclair, runs on the 2.6.29 Linux kernel. However, the user space it is built atop Dalvik, a Google-designed custom JVM (Java virtual machine). This is pretty interesting, when you think about it. The core of Android is the linux kernel, and the standard... (5 Replies)
Discussion started by: Neo
5 Replies

3. Android

Android Scripting Environment: Shell Scripting and Android

I just upgraded to Android 2.2 from 2.1. The GPS issue that was troublesome in 2.1 seems to have been fixed. Some of web browsing seems faster, but it could just be my connection is better today ;) Flash works in some browsers but not very good and it is too slow for Flash apps designed for... (0 Replies)
Discussion started by: Neo
0 Replies

4. Android

Basic commands for android!!

Hi, I have a n android phone and just rooted it. I access it using 'terminal Emulator'. I performed many basic linux-like commands in the terminal like rm,ls,df,reboot etc and they are working fine. But many of them are not like man <something>, clear,du etc. Can any of you please help to... (20 Replies)
Discussion started by: shekhar_4_u
20 Replies

5. Android

Security in Android apps

Hi, I am Conrad I was wondering, if anybody would be able to hack accounts on Android apps. I mean for example we are logged on ebay or Facebook app, and we simply quit to home screen, without logging out, and also disconnect from network and again turn on network. -To the point, Is it... (0 Replies)
Discussion started by: kondziorek
0 Replies
SDL::Tutorial::Drawing(3)				User Contributed Perl Documentation				 SDL::Tutorial::Drawing(3)

NAME
SDL::Tutorial::Drawing - basic drawing with Perl SDL SYNOPSIS
# to read this tutorial $ perldoc SDL::Tutorial::Drawing # to create a bare-bones SDL app based on this tutorial $ perl -MSDL::Tutorial::Drawing=basic_app.pl -e 1 DRAWING BASICS
As explained in SDL::Tutorial, all graphics in SDL live on a surface. Consequently, all drawing operations operate on a surface, whether drawing on it directly or blitting from another surface. The important modules for this exercise are SDL::Rect and SDL::Color. As usual, we'll start by creating a SDL::App object: use SDL::App; my $app = SDL::App->new( -width => 640, -height => 480, -depth => 16, ); Creating a New Surface with SDL::Rect A SDL::Rect object is an SDL surface, just as an SDL::App object is. As you'd expect, you need to specify the size of this object as you create it. You can also specify its coordinates relative to the origin. Note: The origin, or coordinates 0, 0, is at the upper left of the screen. Here's how to create a square 100 pixels by 100 pixels centered in the window: use SDL::Rect; my $rect = SDL::Rect->new( -height => 100, -width => 100, -x => 270, -y => 390, ); This won't actually display anything yet, it just creates a rectangular surface. Of course, even if it did display, you wouldn't see anything, as it defaults to the background color just as $app does. That's where SDL::Color comes in. A Bit About Color SDL::Color objects represent colors in the SDL world. These colors are additive, so they're represented as mixtures of Red, Green, and Blue components. The color values are traditionally given in hexadecimal numbers. If you're exceedingly clever or really like the math, you can figure out which values are possible by comparing them to your current bit depth. SDL does a lot of autoconversion for you, though, so unless extreme speed or pedantic detail are important, you can get by without worrying too much. Creating a color object is reasonably easy. As the color scheme is additive, the lower the number for a color component, the less of that color. The higher the number, the higher the component. Experimentation may be your best bet, as these aren't exactly the primary colors you learned as a child (since that's a subtractive scheme). Let's create a nice, full blue: use SDL::Color; my $color = SDL::Color->new( -r => 0x00, -g => 0x00, -b => 0xff, ); Note: The numbers are in hex; if you've never used hex notation in Perl before, the leading "0x" just signifies that the rest of the number is in base-16. In this case, the blue component has a value of 255 and the red and green are both zero. Filling Part of a Surface The "fill()" method of SDL::Surface fills a given rectangular section of the surface with the given color. Since we already have a rect and a color, it's as easy as saying: $app->fill( $rect, $color ); That's a little subtle; it turns out that the SDL::Rect created earlier represents a destination within the surface of the main window. It's not attached to anything else. We could re-use it later, as necessary. Updating the Surface If you try the code so far, you'll notice that it still doesn't display. Don't fret. All that's left to do is to call "update()" on the appropriate surface. As usual, "update()" takes a Rect to control which part of the surface to update. In this case, that's: $app->update( $rect ); This may seem like a useless extra step, but it can be quite handy. While drawing to the screen directly seems like the fastest way to go, the intricacies of working with hardware with the appropriate timings is tricky. Working With The App You can, of course, create all sorts of Rects with different sizes and coordinates as well as varied colors and experiment to your heart's content drawing them to the window. It's more fun when you can animate them smoothly, though. That, as usual, is another tutorial. SEE ALSO
SDL::Tutorial the basics of Perl SDL. SDL::Tutorial::Animation basic animation techniques AUTHOR
chromatic, <chromatic@wgz.org> Written for and maintained by the Perl SDL project, <http://sdl.perl.org/>. BUGS
No known bugs. COPYRIGHT
Copyright (c) 2003 - 2004, chromatic. All rights reserved. This module is distributed under the same terms as Perl itself, in the hope that it is useful but certainly under no guarantee. perl v5.12.1 2010-07-05 SDL::Tutorial::Drawing(3)
All times are GMT -4. The time now is 04:17 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy