Apr 28, 2017, 12:47 PM *
Welcome, Guest.



Did you miss your activation email?

Login with username, password and session length
   Home   Help Search Login Register  
Pages: [1] 2 3 ... 10
 on: Apr 20, 2017, 08:58 PM 
Started Chuck - Last post by Chuck
Can you guess what SetDrawingBufferOffest offsetX, offsetY does?

' ********************
' ** Analoge Clock  **
' **    (C) 2011    **
' ** Thomas Krueger **
' ********************

SETSCALE 479,799
StrokeWidth 3


COLOR 75,0,0

DrawingBuffer on

color 0,0,0

FOR w=0 TO 360 STEP 6
  COLOR 75,0,0
  LINE x,y,SIN(w)*20+x,COS(w)*20+y
  IF (w%30)=0 THEN
    COLOR 0,0,75
    LINE x,y,SIN(w)*40+x,COS(w)*40+y

DrawingBuffer off

ox = 0
oy = 0

  IF so<>s THEN

    COLOR 0,100,0
    LINE tx,ty,SIN(180-(m*6))*155+tx,COS(180-(m*6))*155+ty
    LINE tx,ty,SIN(180-(w*30)-(m*0.5))*120+tx,COS(180-(w*30)-(m*0.5))

    COLOR 0,25,0
    LINE tx,ty,SIN(180-(s*6))*155+tx,COS(180-(s*6))*155+ty
    CIRCLE SIN(180-(s*6))*140+tx,COS(180-(s*6))*140+ty,10,1

  setDrawingBufferOffset ox, oy
  ox += 2
  oy += 2


 on: Apr 17, 2017, 06:26 PM 
Started Chuck - Last post by Chuck
I just finished adding a new graphics command which will allow you to buffer drawing commands to be drawn automatically right after a cls (clear screen). This is for the regular graphics mode.

Graphics on

DrawingBuffer on
color 0,0,100,100
color 100,0,0,100
line 0,0,screenX(), screenY()

DrawingBuffer off

Now whenever you clear the screen the buffered drawing commands are automatically drawn in for you at high speed.

Then you can enter your draw loop and do animation or whatever over the pre-drawn background.

Expect this in Version 8.

 on: Apr 17, 2017, 07:52 AM 
Started dstmartin - Last post by mjcoon
I'm doing an overhaul on Basic atm or I would have got it done by now. I'll keep it at the top of my list.

Could you email ( ) me one of your xml files for testing. Nothing with sensitive data. I've still got a ton of work planned before I'll get to it, but if I have your file and kinda know how you will be using it, you will get just want you need. I expect you will say something like:

Open 1, "my.xml", "r"
ReadXml 1, hashtable
Close 1

and you get a hashtable filled by the xml file. Easy.

I suppose we also need a write command:

WriteXml n, hashtable
I think I'd need more of a hint how this might work. IIRC XML allows container objects potentially with a list of subordinates. In KML, such as a "path" with multiple co-ordinates making up the path. But a hashtable does not seem to fit...


 on: Apr 13, 2017, 07:49 AM 
Started gianfry56 - Last post by gianfry56
Sorry Chuck, maybe I explained  wrong.
Only a function to inform me if the device has a keyboard soft or hard...

How do you determine if the graphics area is of 2560 or of 2392 pixels for screenY() function?

 on: Apr 13, 2017, 07:32 AM 
Started gianfry56 - Last post by Chuck
Android doesn't provide a way to intercept characters from the soft keyboard. Also it's not possible to bring up the soft keyboard unless an input field has focus on the screen.

 on: Apr 12, 2017, 10:34 PM 
Started gianfry56 - Last post by gianfry56
Last question about this arguments  Smiley
is possible to get, maybe in new version 8, a function IsSoftKeys() which returns:
- True in case of soft keys
- False in case of hard keys
this would help programming.

good job Chuck

 on: Apr 12, 2017, 09:51 AM 
Started gianfry56 - Last post by Chuck
I've found the problem. Bitmaps are using the diagonal ratio like it was a circle. If I change it so bitmaps are scaled using the setscale x and y ratios bitmaps will then be skewed when displayed on different ratios. The advantage of using a single diagonal ratio is that bitmaps are not skewed.

Below are the scale calculations and the source code for the method that draws the bitmap.

_scaleX = actual width / scaled width
_scaleY = actual height / scaled height
_scaleRadius = actual diagonal length / scaled diagonal length

public static void drawBitmap(Bitmap bitmap, float x, float y, float degRot, float scaleX, float scaleY) {


float cx = scaleX(x);
float cy = scaleY(y);

Matrix matrix = new Matrix();
matrix.postTranslate(cx - (float) bitmap.getWidth()/2, cy - (float) bitmap.getHeight()/2);
matrix.postScale(scaleX * _scaleRadius, scaleY * _scaleRadius, cx, cy);
matrix.postRotate(degRot, cx, cy);

drawingCanvas.drawBitmap(bitmap, matrix, drawingPaint);


Check out the post below.

SetScale in combination w/ Circle and bitmaps

 on: Apr 12, 2017, 08:20 AM 
Started gianfry56 - Last post by Chuck
I've been looking at your images more closely and now I'm not sure what is going on. I will test it shortly.

 on: Apr 12, 2017, 08:17 AM 
Started gianfry56 - Last post by Chuck
1440x2392 is the drawable area. It's correct because you can't draw on the soft buttons.

This is a problem with Basic. It needs to subtract the soft button area to get the right scaling ratio. As soon as I get off work I will work on it. This is a new problem since Android didn't have soft buttons when I added the setscale command.

 on: Apr 12, 2017, 08:11 AM 
Started gianfry56 - Last post by gianfry56
I have to understand something fundamental to continue:
on my phone with resolution 1440x2560, ScreenY() return 2392: this is correct  or not?

Pages: [1] 2 3 ... 10
Powered by SMF 1.1.21 | SMF © 2015, Simple Machines
Page created in 0.078 seconds with 15 queries.