Page 1 of 1

The Apple pencil stylus

Posted: Wed Oct 03, 2018 9:33 am
by Henko
Recently, ELectronic Arts decided to discontinue their current "Risk" game at the introduction of iOS 12, and bring out a new version of it under another name and price. As i don't want to pay twice for the same game, i decided to "freeze" my iPad air to iOS 11 to keep "Risk" (and the current version of SmartBasic for that matter) and purchased a new iPad "2018" which will be kept up to date.
Like the "pro" versions of the iPad, the new iPad 2018 supports the Apple pencil and i wanted to try it.

I am now busy to make my own version of Risk in SB.
I started with copying the "world" from the iPad screen using a sheet of transparantpaper, made a small program to pick up touches of the Apple pencil and file the pixel coordinates.
With the pencil, it took me about 5 minutes to record the 172 nodal point.
The sheet of transparant paper :
E32C81BB-988C-4F22-9FDD-0161DAD95A58.jpeg
E32C81BB-988C-4F22-9FDD-0161DAD95A58.jpeg (1.49 MiB) Viewed 2114 times

After jotting down the nodal point numbers of each of the 42 countries, the map was easily programmed, using the "poly draw" and "poly fill" instructions.
Selecting of countries during the game is done by little buttons (which will also be used to show the strength data of the country). The locations of these buttons were also picked up with use of the pencil in an "eyewink".
The current status :
A8B4E68C-75CD-4EAB-995C-3BDF48A2BA05.png
A8B4E68C-75CD-4EAB-995C-3BDF48A2BA05.png (351.77 KiB) Viewed 2114 times

Just to show a nice application of this stylus. It produces high precision relative to the other cheap) stylusses.

Re: The Apple pencil stylus

Posted: Thu Oct 04, 2018 8:42 am
by Dutchman
Is the interaction with SB simple via the touch commands?

Re: The Apple pencil stylus

Posted: Thu Oct 04, 2018 9:19 am
by Henko
Dutchman wrote:
Thu Oct 04, 2018 8:42 am
Is the interaction with SB simple via the touch commands?
Yes, i used the following code snippet to fetch the start- and endpoints of the dotted lines (with the transparant paper aligned on the iPad screen.

Code: Select all

graphics ! graphics clear 1,1,1
do slowdown
  get touch 0 as x,y
  if x<>-1 then
    file "lines" print int(x),int(y)
    pause .3
    end if
  until y>750
end
The PAUSE .3 is needed to prevent multiple registrations when touching the surface.

Re: The Apple pencil stylus

Posted: Fri Oct 05, 2018 5:25 am
by rbytes
I wish I was upgrading my iPad this year. I would like to try the Apple Pencil. But it won't be until at least June next year. Meantime I searched on Amazon for the best-rated active stylus compatible with older iPads. The Heiyo rated 4.5/5, so I ordered one, and it should arrive tomorrow. At least I can be sure that if I am not happy with it, Amazon will take it back for a full refund. They even pay for return shipping.

Update. The Heiyo pen arrived as promised, and I tested it with a a professional drawing app -ArtStudio SB program. It is very responsive.

The I tried it in my SB program Painter. I will have to change my code a bit, because tapping does not draw anything. The pen has to move before anything appears. So to dot an I, I have to move back and forth a bit.