Scene display methods, device and terminal
Technical field
The present invention relates to internet terminal field, more particularly to a kind of scene display methods, device and terminal.
Background technology
The terminal of such as smart mobile phone, tablet personal computer or desktop computer etc is essential in people's daily life
Instrument, the different application in using terminal can realize different functions.
By taking immediate communication tool as an example, it is live to watch amusement audio frequency and video that user can use immediate communication tool.Seeing
When seeing that amusement audio frequency and video are live, immediate communication tool can show a scene.The scene can include video, ballot region,
Chat area, subscription region and object area etc. some of giving a present.User can watch video in this scene, and make
With the function for thing etc of voting, chat, subscribe to and give a present.
During the present invention is realized, inventor has found that prior art at least has problems with:Due to different ends
The differences in resolution of display screen is huge used in end, such as the resolution ratio of the display screen of desktop computer may be 2560 pixels
Any one in x1440 pixels, the pixels of 1920 pixel * 1080, the pixels of 1440 pixel * 900 and the pixels of 1024 pixel * 768.When
Same scene is in the display screen display of different resolution, and the final display effect presented can also have huge difference
It is different so that display effect of the scene on the display screen of some resolution ratio is very outstanding, but may be differentiated in other
Display effect on the display screen of rate is excessively poor.
The content of the invention
In order to solve the problem of display effect of the Same Scene on the display screen of different resolution has larger difference, this
Inventive embodiments provide a kind of scene display methods, device and terminal.The technical scheme is as follows:
According to an aspect of the invention, there is provided a kind of scene display methods, methods described includes:
Obtain the screen resolution of current device;
It is loaded into from least two sets default scenes and the scene corresponding to the screen resolution;
According to the scene setting current scene parameter of loading;
At least one subboard is loaded, and causes the subboard to be completed to initialize according to the current scene parameter;
The scene is shown according to the subboard after initialization.
Further, the screen resolution for obtaining current device, including:
The predetermined API provided by operating system obtains the screen resolution.
Further, it is described to be loaded into from least two sets default scenes and the scene corresponding to the screen resolution, bag
Include:
Determine the resolving range residing for the screen resolution;
According to the resolving range and the corresponding relation of scene prestored, inquiry and point residing for the screen resolution
Scene corresponding to resolution scope;
It is loaded into the scene inquired.
Further, the scene setting current scene parameter according to loading, including:
At least one first parameter prestored in the scene is read as one in the current scene parameter
Point;
At least one second parameter is calculated as another portion in the current scene parameter according to the screen resolution
Point;
First parameter includes the displaing coordinate of all or part of object shown in the scene;Second parameter
In displaing coordinate, display mode and animation path length including all or part of animation shown in the scene at least
A kind of parameter.
Further, at least one subboard of the loading, and cause the subboard according to the current scene parameter
Initialization is completed, including:
Load at least one subboard, and cause the subboard according in the current scene parameter with the subboard
The parameter of at least one corresponding first and/or at least one second parameter complete initialization.
According to the second aspect of the invention there is provided a kind of scene display device, described device includes:
Acquisition module, the screen resolution for obtaining current device;
Insmod, for being loaded into the screen resolution got with the acquisition module from least two sets default scenes
Corresponding scene;
Setup module, the scene setting current scene parameter for the loading that insmoded according to;
Load-on module, for loading at least one subboard, and causes the subboard to be set according to the setup module
The current scene parameter complete initialization;
Display module, the scene is shown for the subboard after the initialization that is loaded according to the load-on module.
Further, the acquisition module, is obtained specifically for the predetermined API provided by operating system
The screen resolution.
Further, it is described to insmod, including:Scope determining unit, scenario queries unit and scene are loaded into unit;
The scope determining unit, for determining the resolving range residing for the screen resolution;
The scenario queries unit, for the corresponding relation according to the resolving range that prestores and scene, inquiry with
The scene corresponding to the resolving range residing for the screen resolution that the scope determining unit is determined;
The scene is loaded into unit, for being loaded into the scene that the scenario queries unit is inquired.
Further, the setup module, including:Reading unit and computing unit;
The reading unit, at least one first parameter prestored for reading in the scene is as described current
A part in scenario parameters;
The computing unit, for calculating at least one second parameter as the current field according to the screen resolution
Another part in scape parameter;
First parameter includes the displaing coordinate of all or part of object shown in the scene;Second parameter
In displaing coordinate, display mode and animation path length including all or part of animation shown in the scene at least
A kind of parameter.
Further, the load-on module, specifically for loading at least one subboard, and cause the subboard according to
In the current scene parameter that the setup module is set at least one first parameter corresponding with the subboard and/or
At least one second parameter completes initialization.
According to the third aspect of the invention we there is provided a kind of terminal, the terminal include above-mentioned second aspect or on
State the scene display device described in the various further schemes of second aspect.
The beneficial effect that technical scheme provided in an embodiment of the present invention is brought is:
Corresponding scene is selected to enter by pre-setting at least two sets scenes, and according to the screen resolution of current device
Row display;Solve the problem of display effect of the Same Scene on the display screen of different resolution has larger difference;Reach
Ideal display effect can be reached for the scene that the display screen of different resolution is shown so that different resolution
Display screen on result in relatively uniform usage experience.
Brief description of the drawings
Technical scheme in order to illustrate the embodiments of the present invention more clearly, makes required in being described below to embodiment
Accompanying drawing is briefly described, it should be apparent that, drawings in the following description are only some embodiments of the present invention, for
For those of ordinary skill in the art, on the premise of not paying creative work, other can also be obtained according to these accompanying drawings
Accompanying drawing.
Fig. 1 is the method flow diagram for the scene display methods that the embodiment of the present invention one is provided;
Fig. 2A is the method flow diagram for the scene display methods that the embodiment of the present invention two is provided;
Fig. 2 B are the schematic diagram of a scenario for the standard edition scene that the embodiment of the present invention two is provided;
Fig. 2 C are the schematic diagram of a scenario for the compact version scene that the embodiment of the present invention two is provided;
Fig. 3 is the structural representation for the scene display device that the embodiment of the present invention three is provided;
Fig. 4 is the structural representation for the scene display device that the embodiment of the present invention four is provided.
Embodiment
To make the object, technical solutions and advantages of the present invention clearer, below in conjunction with accompanying drawing to embodiment party of the present invention
Formula is described in further detail.
Embodiment one
Fig. 1 is refer to, the method flow diagram of the scene display methods provided it illustrates the embodiment of the present invention one.This implementation
Example is used to illustrate in terminal with the scene display methods.The scene display methods, including:
Step 102, the screen resolution of current device is obtained;
Step 104, it is loaded into and the scene corresponding to screen resolution from least two sets default scenes;
Step 106, according to the scene setting current scene parameter of loading;
Step 108, at least one subboard is loaded, and causes subboard to be completed to initialize according to current scene parameter;
Step 110, the scene is shown according to the subboard after initialization.
In summary, the scene display methods that the present embodiment is provided, by pre-setting at least two sets scenes, and according to ought
The screen resolution of preceding equipment selects the corresponding scene to be shown;Solve display screen of the Same Scene in different resolution
On display effect the problem of there is larger difference;Reach that the scene shown for the display screen of different resolution can reach
To ideal display effect so that result in relatively uniform usage experience on the display screen of different resolution.
Embodiment two
Fig. 2A is refer to, the method flow diagram of the scene display methods provided it illustrates the embodiment of the present invention two.This reality
Example is applied with the scene display methods to contain illustrating in the terminal for having immediate communication tool.As based on embodiment one
There is provided in particularly preferred embodiment two, the present embodiment and illustrated using default scene as two sets.The scene display methods, bag
Include:
Step 202, the screen resolution of current device is obtained;
After immediate communication tool in the terminal starts, the client of the immediate communication tool creates a window first,
Then the predetermined API that the client can be provided by operating system obtains the screen resolution of current device.Than
Such as, so that the client of the immediate communication tool is MusicClient as an example, after MusicClinet startups,
MusicClinet can create MusicWindow first, and then MusicClient can be provided previously by according to operating system
API(Application Programming Interface, application programming interface)To obtain the screen point of current device
Resolution, it is assumed that the screen resolution of the current device got is the pixels of 1920 pixel * 1080.
Step 204, the resolving range residing for screen resolution is determined;
In order to be loaded into and the scene corresponding to screen resolution from least two sets default scenes, it is necessary first to it is determined that current
Resolving range residing for the screen resolution of equipment.In the present embodiment, with there is provided standard edition scene and compact version scene
Preset scenes to illustrate for totally two sets.Wherein, standard edition scene is applied to resolution ratio more than or equal to the pixels of 1440 pixel * 900
Display screen show that compact version scene is applied to resolution ratio and is more than or equal to the pixels of 1024 pixel * 768 and resolution ratio to be less than 1440 pictures
The display screen of plain * 900 pixel is shown.
With reference to Fig. 2 B and Fig. 2 C are referred to, which respectively show standard edition scene and the schematic diagram of a scenario of compact version scene.Should
Scene display has gone out a movie theatre scene for including giant screens.The scene includes have powerful connections 21, giant screens 22, left side race
Road 23, right side runway 24, the first seating area 25a(Seating area positioned at left side and on step), second seat area 25b(It is located at
Left side and the seating area under step), the 3rd seating area 25c(Seating area centrally located and on step), the 4th seating area
25d(Seating area centrally located and under step), the 5th seating area 25e(Seating area positioned at right side and on step)With
Six seating area 25f(Seating area positioned at right side and under step)Etc. multiple objects.The specific object of display can be with scene
It is different according to different embodiments, there may be object area of giving a present, subscribe to region, broadcast message display area etc..Mark
Quasi- version scene and compact version scene it is identical in that the object of display is essentially identical, difference is that standard edition scene is shown
Effective area it is bigger, the display location of portions of display content is different, such as the distance between two seats in seating area can
With difference;Part shows that the display location of animation is different with animation effect, such as it is dynamic that one automobile of displaying on runway is run
During picture, the initial distance for position occur and running of automobile can be different.
Because standard edition scene and compact version scene are all possibly used for more than one resolution ratio, in order to preferably be applicable difference
Resolution ratio.When resolution ratio is more than 1440 pixel 900 pixels of *, the scene both sides of standard edition scene and lower section are used and scene
Corresponding pattern filling, can be displayed in full screen on a display screen;When resolution ratio is more than the pixels of 1024 pixel * 768 and resolution
When rate is less than 1440 pixel 900 pixels of *, the scene both sides and lower section of compact version scene are filled using pattern corresponding with scene,
It can be displayed in full screen on a display screen.Under another realization, standard edition scene and compact version scene are provided with one
The higher background picture of individual resolution ratio so that can completely show a scene on screen under different resolution, than
Such as compact version scene, the background picture that a resolution ratio is the pixels of 1440 pixel * 900 can be provided previously by, no matter then
When any resolution ratio of the compact version scene in its corresponding resolving range is shown, the background picture can be pressed
Contracting display, enables to be displayed in full screen on a display screen.
For other objects of standard edition scene and compact version scene, each object may be by a corresponding son
Plug-in unit is responsible for display, such as giant screens 22 can be responsible for display by net cast subboard, and each seating area can be by
Subregion subboard is responsible for display.Need to be adjusted according to different resolution ratio during this, step as described below.
, can be with if default scene is two or more it is determined that during resolving range residing for the resolution ratio got
Multiple resolving ranges are previously stored with, then after the resolution ratio of current device is got, the resolution ratio of current device are inquired about
Residing resolving range.But in this step, due to only providing two sets of scenes, so getting the resolution ratio of current device
Afterwards, directly judge whether the resolution ratio of current device is less than default resolution ratio(The pixels of 1440 pixel * 900);If judged result is
The resolution ratio of current device is less than default resolution ratio, it is determined that the resolution ratio of current device belongs to the first scope;If judged result
It is more than or equal to default resolution ratio for the resolution ratio of current device, it is determined that the resolution ratio of current device belongs to the second scope.
Step 206, according to the resolving range and the corresponding relation of scene prestored, residing for inquiry and screen resolution
Resolving range corresponding to scene;
In the present embodiment, the client of the immediate communication tool in terminal can prestore resolving range and scene it
Between corresponding relation, such as, and the corresponding relation prestored be " the first scope is corresponding with compact version scene " and " the second scope and
Standard edition scene correspondence.”
When the resolving range for the current device determined in previous step is the first scope, according to above-mentioned corresponding relation,
Compact version scene, which can be inquired, is and the scene corresponding to the resolving range residing for screen resolution;Determined in previous step
When the resolving range of the current device gone out is the second scope, according to above-mentioned corresponding relation, can inquire standard edition scene is
With the scene corresponding to the resolving range residing for screen resolution.
Step 208, it is loaded into the scene inquired;
The client of immediate communication tool in terminal can be previously stored with standard edition scene and compact version scene.Then
The scene inquired is loaded into according to the Query Result in step 206.Such as, if the screen resolution of current device is 1920 pictures
Plain * 1080 pixel, the then scene inquired is standard edition scene, and client is loaded into standard edition scene.
Step 210, according to the scene setting current scene parameter of loading;
The client of immediate communication tool in terminal can be according to the scene setting current scene parameter of loading.Such as,
So that the client of the immediate communication tool is MusicClient as an example, after MusicClient creates MusicWindow,
MusicWindow is loaded into scene and sets MusicLayout according to the screen resolution of current device to join as current scene
Number.Specifically, because a part of scenario parameters are thick-and-thin, such as the displaing coordinates of some display objects, these
Scape parameter can be prestored in the scene, and obtain these parameters after scene is loaded into, and these parameters can be referred to as the
One parameter;But another part scenario parameters are needed according to different change resolutions, than in such as above-mentioned seating area two
Interval between individual seat can change according to different resolution ratio;Also such as, show that a car is run on left side runway 23
During dynamic animation, the initial display position of car and the distance run on runway can change according to different resolution ratio;
For another example, when showing that a Little Bear is gone to send colored animation below giant screens 22 from outside on right side runway 24, at the beginning of Little Bear
Beginning display location and the distance run on runway can be changed according to different resolution ratio.Therefore, this step can include:
First, at least one first parameter prestored in the scene being loaded into is read as one in current scene parameter
Part;Second, at least one second parameter is calculated as another in current scene parameter according to the screen resolution of current device
A part.Wherein, the first parameter is the parameter that need not be changed according to screen resolution in the scene, and the second parameter is this
The parameter changed according to screen resolution is needed in scene.First parameter can include whole or the portion shown in the scene
Divide the displaing coordinate of object, such as the displaing coordinate for object area of giving a present;Second parameter includes whole or the portion shown in scene
Shown at least one of displaing coordinate, display mode and the animation path length that transfer is drawn parameter, such as left side runway 23
In the animation that one car is run, the parameter such as the initial display position of car and the distance run on runway.
Step 212, at least one subboard is loaded, and causes subboard to be completed to initialize according to current scene parameter;
Then, the client of the immediate communication tool in terminal loads at least one subboard, and causes each subboard
Completed according at least one first parameter corresponding with the subboard in current scene parameter and/or at least one second parameter
Initialization.In other words, each subboard is used to show one or more than one object in scene.One subboard can
To have one corresponding with its own or more than one parameter in current scene parameter, the parameter is probably above-mentioned
One parameter, it is also possible to the second above-mentioned parameter.After subboard obtains the parameter, Initialize installation can be completed.Such as, with
The client of the immediate communication tool is exemplified by MusicClient, each subboard can join according to corresponding MusicLayout
Count to complete initialization procedure.
In the present embodiment, subboard can include being used to show giant screens 22 and show video in giant screens 22
Video subboard, the subregion subboard for showing each seating area, for show give a present object area present subboard, use
In display car run on left side runway 23 appearance show animation subboard, for showing that Little Bear is run on right side runway 24
Send colored animation subboard, the display subboard for showing broadcast message, for subscription subboard of subscription etc..Need
Bright, in various embodiments, it is necessary to which the subboard being loaded into is possibly different from, the example above is only explanation, does not do and has
The restriction of body.
Step 214, scene is shown according to the subboard after initialization.
The client of immediate communication tool in terminal can show scene according to the subboard after initialization.Such as, depending on
Frequency subboard can show giant screens 22 and show video in giant screens 22 after initialization procedure is completed;Subregion
Plug-in unit can show each seating area, and show corresponding user's head portrait etc. on each seat, no longer repeat one by one.
In summary, the scene display methods that the present embodiment is provided, by pre-setting at least two sets scenes, and according to ought
The screen resolution of preceding equipment selects the corresponding scene to be shown;Solve display screen of the Same Scene in different resolution
On display effect the problem of there is larger difference;Reach that the scene shown for the display screen of different resolution can reach
To ideal display effect so that result in relatively uniform usage experience on the display screen of different resolution.Meanwhile,
If subboard includes relating to the plug-in unit of animation, the performance of animation can also be controlled according to the screen resolution of current device
Position and mode so that same set of animation can be shared on the display screen of a variety of resolution ratio, it is not necessary to be different resolution ratio
A set of animation is specially developed, R&D costs are saved.
Embodiment three
Fig. 3 is refer to, the block diagram of the scene display device provided it illustrates the embodiment of the present invention three.The scene
Display device can be implemented as a part for a terminal or a terminal by the combination of software, hardware or both.
The scene display device, including acquisition module 310, the 330, setup module 350 that insmods, setup module 370 and load-on module
390。
Acquisition module 310, the screen resolution for obtaining current device;
330 are insmoded, for being loaded into the screen got with the acquisition module 310 from least two sets default scenes
Scene corresponding to resolution ratio;
Setup module 350, the scene setting current scene parameter for 330 loadings that insmoded according to;
Load-on module 370, for loading at least one subboard, and causes the subboard according to the setup module
The 350 current scene parameters set complete initialization;
Display module 390, described in being shown according to the subboard after the initialization that the load-on module 370 is loaded
Scene.
In summary, the scene display device that the present embodiment is provided, by pre-setting at least two sets scenes, and according to ought
The screen resolution of preceding equipment selects the corresponding scene to be shown;Solve display screen of the Same Scene in different resolution
On display effect the problem of there is larger difference;Reach that the scene shown for the display screen of different resolution can reach
To ideal display effect so that result in relatively uniform usage experience on the display screen of different resolution.
Example IV
Fig. 4 is refer to, the block diagram of the scene display device provided it illustrates the embodiment of the present invention four.The scene
Display device can be implemented as a part for a terminal or a terminal by the combination of software, hardware or both.
The scene display device, including acquisition module 310, the 330, setup module 350 that insmods, setup module 370 and load-on module
390。
Acquisition module 310, the screen resolution for obtaining current device;
330 are insmoded, for being loaded into the screen got with the acquisition module 310 from least two sets default scenes
Scene corresponding to resolution ratio;
Setup module 350, the scene setting current scene parameter for 330 loadings that insmoded according to;
Load-on module 370, for loading at least one subboard, and causes the subboard according to the setup module
The 350 current scene parameters set complete initialization;
Display module 390, described in being shown according to the subboard after the initialization that the load-on module 370 is loaded
Scene.
Specifically, the acquisition module 310, is obtained specifically for the predetermined API provided by operating system
Take the screen resolution.
It is described to insmod 330, including:Scope determining unit 332, scenario queries unit 334 and scene are loaded into unit
336;
The scope determining unit 332, for determining the resolving range residing for the screen resolution;
The scenario queries unit 334, for according to the resolving range and the corresponding relation of scene prestored, inquiry
The scene corresponding to the resolving range residing for the screen resolution determined with the scope determining unit 332;
The scene is loaded into unit 336, for being loaded into the scene that the scenario queries unit 334 is inquired.
The setup module 350, including:Reading unit 352 and computing unit 354;
The reading unit 352, at least one first parameter prestored for reading in the scene is as described
A part in current scene parameter;
The computing unit 354, works as calculating at least one second parameter according to the screen resolution as described
Another part in preceding scenario parameters;
First parameter includes the displaing coordinate of all or part of object shown in the scene;Second parameter
In displaing coordinate, display mode and animation path length including all or part of animation shown in the scene at least
A kind of parameter.
The load-on module 370, specifically at least one subboard of loading, and causes the subboard to be set according to
Put in the current scene parameter of the setting of module 350 at least one first parameter corresponding with the subboard and/or extremely
Few second parameter completes initialization.
In summary, the scene display device that the present embodiment is provided, by pre-setting at least two sets scenes, and according to ought
The screen resolution of preceding equipment selects the corresponding scene to be shown;Solve display screen of the Same Scene in different resolution
On display effect the problem of there is larger difference;Reach that the scene shown for the display screen of different resolution can reach
To ideal display effect so that result in relatively uniform usage experience on the display screen of different resolution.Meanwhile,
If subboard includes relating to the plug-in unit of animation, the performance of animation can also be controlled according to the screen resolution of current device
Position and mode so that same set of animation can be shared on the display screen of a variety of resolution ratio, it is not necessary to be different resolution ratio
A set of animation is specially developed, R&D costs are saved.
It should be noted that:The scene display device that above-described embodiment is provided is when showing scene, only with above-mentioned each function
The division progress of module is for example, in practical application, as needed can distribute above-mentioned functions by different function moulds
Block is completed, i.e., the internal structure of equipment is divided into different functional modules, to complete all or part of work(described above
Energy.In addition, the scene display device that above-described embodiment is provided belongs to same design with scene display methods embodiment, it is specific real
Existing process refers to embodiment of the method, repeats no more here.
The embodiments of the present invention are for illustration only, and the quality of embodiment is not represented.
One of ordinary skill in the art will appreciate that realizing that all or part of step of above-described embodiment can be by hardware
To complete, the hardware of correlation can also be instructed to complete by program, described program can be stored in a kind of computer-readable
In storage medium, storage medium mentioned above can be read-only storage, disk or CD etc..
The foregoing is only presently preferred embodiments of the present invention, be not intended to limit the invention, it is all the present invention spirit and
Within principle, any modification, equivalent substitution and improvements made etc. should be included in the scope of the protection.