You are not logged in.

Dear visitor, welcome to krpano.com Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Monday, June 27th 2011, 8:25am

Want to change font size dynamically according to screen size on Android Devices

Hi,

I want to change font size dynamically according to screen width(resolution) for Android devices. As there are many Android devices available in market from (320 x 280) to (1280 x 800) resolution.

If i set 12px in my any text caption or plugin it's look to small in (1280 x 800) resolution device but it is look perfect on (320 x 280). so now i want font size to be different using "stagewidth". i am using HTML and CSS in my "Textfiedl.swf" plugin.

My code is as below
<plugin name="info0" enabled="true" url="plugins/textfield.swf" keep="true" align="top" edge="top" x="0" y="70" width="80%" visible="false" html="[p align='center'][font face='Arial' color='#FFFFFF']some description text comes here....some description text comes here....[/font][/p]" css="p{color:#FFFFFF; font-family:Arial; font-size:12px; font-weight:bold; text-align:center; backgrond=#000000;} a{color:#FFFFFF;}" backgroundalpha="1" backgroundcolor="0x000000" alpha="1" background="false" textshadow="4" />

Is it possible to change css's property according to screen resolution?
OR
Is it possible to change [font] property accordingly? if so how to....

Please help me out.
Thanks in advance

--
Pratiks

This post has been edited 2 times, last edit by "pratiks" (Jun 28th 2011, 7:43am)


2

Tuesday, June 28th 2011, 9:53am

Hi,

Anybody????

Posts: 1,850

Occupation: Virtual Tours - Photography - Krpano developer

  • Send private message

3

Tuesday, June 28th 2011, 11:16pm

Check the screen variables. If the are one size, use set to change the CSS.
KRPano Developer: Portfolio ::Gigapixel Tagging Solutions - Porfolio 2 :: Facebook :: Twitter :: reddit.com/r/VirtualTour

4

Wednesday, June 29th 2011, 6:18am

Hi sachagriffin,

Sorry.... i didn't get you....

--
Pratiks

VN2011

Professional

Posts: 1,336

Location: Duluth MN

  • Send private message

5

Wednesday, June 29th 2011, 2:55pm

he means you have to write some if statements.

IF(screen.width > 1024, set(css action here));

it will take a few of them, that is nto the correct syntax check the docuemtnation.

6

Wednesday, June 29th 2011, 3:06pm

Hi VN2011,

Quoted

IF(screen.width > 1024, set(css action here));

Thanks for your clarification, but still how to write CSS action in "SET()".

Thanks

--
Pratiks

Zephyr

Professional

Posts: 994

Location: Netherlands

Occupation: Web developer

  • Send private message

7

Wednesday, June 29th 2011, 3:12pm

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
if(stagewidth GT 1024,
    set(plugin[inf0].css, data:bigCSS);
,
    set(plugin[inf0].css, data:smallCSS);
);

<data name="bigCSS">
  p{
   fontsize: 20px;
}
</data>

<data name="smallCSS">
  p{
   fontsize: 10px;
}
</data>
3d childrens game using krpano Game
Minify your xml with my krpano XML Compressor
Krpano XML Parsing Error Checklist
Available for hire (krpano xml, javascript, actionscript, flash, php and ipad plugins).

This post has been edited 1 times, last edit by "Zephyr" (Jun 29th 2011, 3:25pm)


8

Monday, July 4th 2011, 7:36am

Hi Zephyr,

Thanks for your help.


--
Pratiks

jpdeglet69

Intermediate

Posts: 212

Location: France

Occupation: VR Maker and Document Management Expert

  • Send private message

9

Monday, July 4th 2011, 11:35pm

Hi,

For my tours, I'm enhancing Textfield plugin to support dynamic CSS font sizing when resizing the stage :
- active on Waiting message, Panorama titles...
Is somebody to "test" on Android
Best regards,
JPhD
VR-Guide®/Eleana CEO
https://vr-guide.online

10

Tuesday, July 5th 2011, 7:03am

Hi jpdeglet69,

If possible, can you please share the .xml or your customize textfield.swf plugin?

Thanks in advance.

--
Pratiks

HansNyb

Professional

Posts: 936

Location: Denmark

Occupation: Photographer

  • Send private message

11

Tuesday, July 5th 2011, 8:37am

For my tours, I'm enhancing Textfield plugin to support dynamic CSS font sizing when resizing the stage :
- active on Waiting message, Panorama titles...
Is somebody to "test" on Android



Tested it on my HTC Desire Z.
Panos loads fine but only way to navigate is the hotspots.
Map does not work. It refuses to open
, and even if it would open the spots would be too small for the 800x480 resolution.

There are no zoom buttons so no zoom is available on Flash touch devices.
All buttons are too small and very difficult to hit.

For some reason it does not work in portrait. In portrait pano stays as landscape at a small area in centre.

Hans

jpdeglet69

Intermediate

Posts: 212

Location: France

Occupation: VR Maker and Document Management Expert

  • Send private message

12

Tuesday, July 5th 2011, 9:12am

For my tours, I'm enhancing Textfield plugin to support dynamic CSS font sizing when resizing the stage :
- active on Waiting message, Panorama titles...
Is somebody to "test" on Android



Tested it on my HTC Desire Z.
Panos loads fine but only way to navigate is the hotspots.
Map does not work. It refuses to open
, and even if it would open the spots would be too small for the 800x480 resolution.

There are no zoom buttons so no zoom is available on Flash touch devices.
All buttons are too small and very difficult to hit.

For some reason it does not work in portrait. In portrait pano stays as landscape at a small area in centre.

Hans


Many Thanks Hans,

If you have some times, try again, you can dynamically adjust the resizing ratio by modifying my t.wdt parameters
Examples

- 600
http://www.jphd360.net/visites/LaGSalama….html?t.wdt=600

- 800
http://www.jphd360.net/visites/LaGSalama….html?t.wdt=800

Regarding Map problem, I need more time (and a device) to investigate !!!
Nevertheless, you can test with this couple of parameters t.map=1 t.pin=1

- 600 and Map should be opened and fixed
http://www.jphd360.net/visites/LaGSalama…t.map=1&t.pin=1
Best regards,
JPhD
VR-Guide®/Eleana CEO
https://vr-guide.online

13

Tuesday, July 5th 2011, 1:50pm

Hi jpdeglet69,

Can you share that code of dynamic font size according to screen size with me?

I will be very thankful to you for this.

--
Pratiks

jpdeglet69

Intermediate

Posts: 212

Location: France

Occupation: VR Maker and Document Management Expert

  • Send private message

14

Tuesday, July 5th 2011, 1:56pm

Hello Pratiks,

Probably yes, but I need some time to prepare a "Krpano" version...
So wait a little ;-)
Best regards,
JPhD
VR-Guide®/Eleana CEO
https://vr-guide.online

15

Tuesday, July 5th 2011, 2:01pm

Hi jpdeglet69,

Thank a lot...
can you give me some hint what should i have to change in XML? so that i can do some R&D stuff meanwhile.

--
Pratiks

HansNyb

Professional

Posts: 936

Location: Denmark

Occupation: Photographer

  • Send private message

16

Tuesday, July 5th 2011, 3:20pm

f you have some times, try again, you can dynamically adjust the resizing ratio by modifying my t.wdt parameters
Examples

- 600
http://www.jphd360.net/visites/LaGSalama….html?t.wdt=600

- 800
http://www.jphd360.net/visites/LaGSalama….html?t.wdt=800

Regarding Map problem, I need more time (and a device) to investigate !!!
Nevertheless, you can test with this couple of parameters t.map=1 t.pin=1

- 600 and Map should be opened and fixed
http://www.jphd360.net/visites/LaGSalama…t.map=1&t.pin=1


Sorry none of them will work in portrait on my Android Desire Z

The map on No 3 does not open again when you close it.

Hans

jpdeglet69

Intermediate

Posts: 212

Location: France

Occupation: VR Maker and Document Management Expert

  • Send private message

17

Tuesday, July 5th 2011, 3:37pm

Very interesting Hans,

So your HTC Desire is in portrait mode, (width=480...), for sure it is very small !!!
And in Landscape mode (width =800) ?
Regarding Map, when closed, it's too small to click on it.

Many thanks for your time and your feed-back.

In the same time, my tours (from 300 Mo to 500 Mo) are not really intended for these devices ;-)
Best regards,
JPhD
VR-Guide®/Eleana CEO
https://vr-guide.online

HansNyb

Professional

Posts: 936

Location: Denmark

Occupation: Photographer

  • Send private message

18

Tuesday, July 5th 2011, 6:17pm

Regarding Map, when closed, it's too small to click on it.


Yes but something seems to make it close again when trying to open it.
It should not do that.

Hans

jpdeglet69

Intermediate

Posts: 212

Location: France

Occupation: VR Maker and Document Management Expert

  • Send private message

19

Tuesday, July 5th 2011, 7:06pm

Oh...

Strange, *confused*
I don't have this trouble on any workstations tested on Windows / Mac / Linux and one Dell Streak "Android"

In fact the map is managed on 2 modes :

1) opened on "onover" and minimized on "onout"

or when opened

2) it can be fixed / detached by clicking on the pin
perhaps too small in your configuration !!!
Best regards,
JPhD
VR-Guide®/Eleana CEO
https://vr-guide.online

This post has been edited 1 times, last edit by "jpdeglet69" (Jul 5th 2011, 7:28pm)


HansNyb

Professional

Posts: 936

Location: Denmark

Occupation: Photographer

  • Send private message

20

Tuesday, July 5th 2011, 10:14pm

In fact the map is managed on 2 modes :

1) opened on "onover" and minimized on "onout"


If you have that it will of course close again and you can never open it.
You can not do an onover on a touchdevice without also making an onout.

Hans