WO2019029379A1 - 交互对象控制方法、装置、终端及计算机可读存储介质 - Google Patents
交互对象控制方法、装置、终端及计算机可读存储介质 Download PDFInfo
- Publication number
- WO2019029379A1 WO2019029379A1 PCT/CN2018/097250 CN2018097250W WO2019029379A1 WO 2019029379 A1 WO2019029379 A1 WO 2019029379A1 CN 2018097250 W CN2018097250 W CN 2018097250W WO 2019029379 A1 WO2019029379 A1 WO 2019029379A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- logical
- pixel density
- terminal
- logical pixels
- touch screen
- Prior art date
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/01—Input arrangements or combined input and output arrangements for interaction between user and computer
- G06F3/03—Arrangements for converting the position or the displacement of a member into a coded form
- G06F3/041—Digitisers, e.g. for touch screens or touch pads, characterised by the transducing means
- G06F3/0416—Control or interface arrangements specially adapted for digitisers
- G06F3/0418—Control or interface arrangements specially adapted for digitisers for error correction or compensation, e.g. based on parallax, calibration or alignment
- G06F3/04186—Touch location disambiguation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/01—Input arrangements or combined input and output arrangements for interaction between user and computer
- G06F3/048—Interaction techniques based on graphical user interfaces [GUI]
- G06F3/0487—Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser
- G06F3/0488—Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser using a touch-screen or digitiser, e.g. input of commands through traced gestures
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/01—Input arrangements or combined input and output arrangements for interaction between user and computer
- G06F3/03—Arrangements for converting the position or the displacement of a member into a coded form
- G06F3/041—Digitisers, e.g. for touch screens or touch pads, characterised by the transducing means
- G06F3/0416—Control or interface arrangements specially adapted for digitisers
- G06F3/0418—Control or interface arrangements specially adapted for digitisers for error correction or compensation, e.g. based on parallax, calibration or alignment
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/01—Input arrangements or combined input and output arrangements for interaction between user and computer
- G06F3/048—Interaction techniques based on graphical user interfaces [GUI]
- G06F3/0484—Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
- G06F3/04845—Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range for image manipulation, e.g. dragging, rotation, expansion or change of colour
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/01—Input arrangements or combined input and output arrangements for interaction between user and computer
- G06F3/048—Interaction techniques based on graphical user interfaces [GUI]
- G06F3/0487—Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser
- G06F3/0488—Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser using a touch-screen or digitiser, e.g. input of commands through traced gestures
- G06F3/04883—Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser using a touch-screen or digitiser, e.g. input of commands through traced gestures for inputting data by handwriting, e.g. gesture or text
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/451—Execution arrangements for user interfaces
Definitions
- the embodiments of the present invention relate to the field of human-computer interaction technologies, and in particular, to an interactive object control method, apparatus, terminal, and computer readable storage medium.
- the touch precision and ease of use of the touch screen are also getting higher and higher.
- the interactive object displayed in the application interface can be controlled by a touch operation on the touch screen.
- the action of the interactive object is usually controlled according to the number of logical pixels corresponding to the touch operation of the user.
- the terminal After detecting the sliding operation of the user, the terminal acquires the number of logical pixels corresponding to the sliding operation, and calculates the interaction according to the relationship between the number of logical pixels and the motion amplitude.
- the action amplitude of the object, and the corresponding action is controlled according to the calculated action amplitude.
- the logical pixel density on the touch screen is usually different for different types of terminals, that is, the number of logical pixels corresponding to the sliding operation of the same physical distance is usually different on different touch screens, which is different.
- the control effect on the interactive object is usually different.
- the embodiment of the present application provides an interactive object control method and device. , terminal and computer readable storage medium, the technical solution is as follows:
- an interactive object control method includes:
- the terminal acquires the number of logical pixels corresponding to the touch operation of the interaction object, which is executed in the touch screen of the terminal;
- the terminal acquires a logical pixel density of the touch screen, where the logical pixel density is used to indicate the number of logical pixels included in a unit area of the touch screen;
- the terminal corrects the number of logical pixels corresponding to the touch operation according to the logical pixel density and the reference pixel density;
- the terminal controls the interactive object according to the corrected number of logical pixels.
- an interactive object control apparatus comprising one or more processors, and one or more memories storing program units, wherein the program units are executed by the processor, the program units comprising:
- a pixel number obtaining module configured to acquire a number of logical pixels corresponding to a touch operation performed on the touch object in the touch screen of the terminal;
- a pixel density acquisition module configured to acquire a logical pixel density of the touch screen, where the logical pixel density is used to indicate a number of logical pixels included in a unit area of the touch screen;
- the correction module is configured to correct the number of logical pixels corresponding to the touch operation according to the logical pixel density and the reference pixel density;
- the control module is configured to control the interactive object according to the corrected number of logical pixels.
- a computer readable storage medium wherein a plurality of instructions are stored, the instructions being adapted to be loaded and executed by a processor:
- Obtaining a logical pixel density of the touch screen where the logical pixel density is used to indicate the number of logical pixels included in a unit area of the touch screen;
- the above interactive object is controlled according to the corrected number of logical pixels.
- a terminal in a fourth aspect, includes a processor and a memory.
- the memory stores at least one instruction, and the at least one instruction is loaded and executed by the processor to implement the interactive object control method in the embodiment of the present application.
- the number of logical pixels corresponding to the touch operation is corrected according to the logical pixel density and the reference pixel density of the touch screen, and is controlled according to the corrected number of logical pixels.
- the interactive object enables the control effect of the interactive object to be consistent when the sliding control operation of the same physical distance is performed in any touch screen.
- FIG. 1A is a schematic diagram of a human-machine interaction operation according to an embodiment of the present application.
- FIG. 1B is a schematic diagram of correspondence between logical pixels and physical pixels according to various embodiments of the present application.
- FIG. 2 is a schematic diagram of an implementation process of a solution according to an embodiment of the present application.
- FIG. 3 is a flowchart of an interactive object control method according to an exemplary embodiment of the present application.
- FIG. 4 is a schematic diagram of a logical pixel corresponding to a touch operation according to the embodiment shown in FIG. 3;
- FIG. 5 is a schematic diagram of a logical pixel corresponding to another touch operation according to the embodiment shown in FIG. 3; FIG.
- FIG. 6 is a schematic diagram of a logical pixel corresponding to another touch operation according to the embodiment shown in FIG. 3; FIG.
- FIG. 8 is a schematic diagram of another logic pixel density acquisition process involved in the embodiment shown in FIG. 3; FIG.
- FIG. 9 is a schematic diagram of an interaction interface according to an exemplary embodiment of the present application.
- FIG. 10 is a schematic diagram of another interactive interface according to an exemplary embodiment of the present application.
- FIG. 11 is a block diagram of an interactive object control apparatus according to an exemplary embodiment of the present application.
- FIG. 12 is a schematic structural diagram of an electronic device according to an exemplary embodiment of the present application.
- the solution shown in the various embodiments of the present application can be applied to an electronic device that installs an application of a human-computer interaction type, the electronic device has a touch screen, and the control operation of the interactive object displayed in the application interface of the human-computer interaction type passes The touch operation in the touch screen is implemented.
- the electronic device can be a smart phone, a tablet, an e-book reader, and a professional gaming device with a touch screen.
- FIG. 1A illustrates a schematic diagram of human-computer interaction operation.
- the left area is a mobile operation area
- the right area is an aiming/steering operation area.
- the finger of the user's left hand 102 performs a sliding touch operation in the mobile operation area to control the interaction object movement in the application interface 101 (showing the movement of the scene in the interface of the FPS application), the moving distance and the user's
- the sliding distance of the finger in the moving operation area is related; the finger of the right hand 103 of the user performs a sliding touch operation in the aiming/steering operation area to control the rotation of the interactive object in the application interface 101 (the perspective is reflected in the interface of the FPS application)
- the rotation angle is related to the sliding distance of the finger in the aiming/steering operation zone.
- a pixel also known as an image element (pixel, px) is the unit of resolution. In electronic devices, it is usually measured in pixels per inch (PPI) or dots per inch (DPI). To indicate the size of the resolution. For example, the resolution of 300x300PPI means that the number of pixels per inch in the horizontal direction and the vertical direction is 300, or it can be expressed as 90,000 (ie, 300x300) pixels in one square inch.
- a pixel has a physical pixel and a logical pixel.
- the physical pixel is also referred to as a device pixel or a hardware pixel, which is determined by the screen hardware of the electronic device.
- Each physical pixel is in the screen of the electronic device and is capable of controlling the minimum unit of display.
- the screen of the electronic device as a light-emitting diode (LED) liquid crystal screen as an example
- the liquid crystal panel of the LED liquid crystal screen divides the liquid crystal body in a grid form, and if the electronic device can separately control and display each liquid crystal body, Then each liquid crystal on the liquid crystal panel is a physical pixel.
- LED light-emitting diode
- the physical pixel number of the screen of the electronic device determines the physical pixel density and physical resolution (or hardware resolution) of the screen. For example, when the physical resolution of the screen of an electronic device is 1024 ⁇ 768, the screen is Dividing 1024 physical pixels horizontally, dividing 768 physical pixels vertically, and physical pixel density is how many physical pixels are arranged per inch in the screen, or how many physical pixels are included in each square inch. point.
- the logical pixels are determined by the system software of the electronic device. Each logical pixel can be regarded as the display area of the screen, and the software program can control the minimum area of the display. Different platforms have different definitions from logical pixels. For example, in the iOS platform, logical pixels are called display points (PTs), while in the Android platform, logical pixels are called device independent Pixels. DP or DiP).
- PTs display points
- DP or DiP device independent Pixels
- the logical pixel density and logical resolution (also referred to as screen resolution) of the screen of the electronic device depends on the current division of the logical pixels of the display area in the screen by the system software. For example, when the logical resolution of an electronic device's screen is 1024 ⁇ 768, it means that the system software divides 1024 logical pixels horizontally in the display area of the screen and 768 logical pixels vertically.
- the logical pixel density is how many logical pixels are arranged per inch in the screen, or how many logical pixels are included in each square inch.
- the display area corresponding to one physical pixel may be divided into one logical pixel, or the display area corresponding to the plurality of physical pixels may be divided into one logical pixel.
- the logic pixels of the screen of the electronic device are software-adjustable.
- the logical pixels when the screen is displayed on the screen of the electronic device also changes, wherein the electronic device
- the screen resolution is usually 1920 ⁇ 1080, 1600 ⁇ 900, 1440 ⁇ 900, 1024 ⁇ 768, and 1366 ⁇ 768; in another case, when the terminal manually zooms the screen currently displayed on the screen, such as zooming one.
- the size of each logical pixel in the picture also changes with the zoom factor.
- FIG. 1B shows a schematic diagram of correspondence between logical pixels and physical pixels involved in various embodiments of the present application.
- the physical resolution of the screen of the terminal is 1920 ⁇ 1080, and the maximum logical resolution supported by the system of the terminal.
- each solid line frame represents one physical pixel
- each dotted line frame represents one logical pixel.
- the terminal displays a picture at a resolution of 1920 ⁇ 1080
- each picture in the picture One pixel corresponds to one physical pixel, and is represented as a solid line frame corresponding to a dotted line frame in FIG.
- the operating system/software program of the electronic device detects the operation range of the touch operation of the user, which is measured in units of logical pixels, for example, the user is on the touch screen.
- the information used to measure the sliding range of the user is how many logical pixels in the screen the sliding operation has passed, and the operating system/ The software program also controls the interactive object based on the number of logical pixels that the sliding operation passes through.
- the number of corresponding logical pixels on the same physical distance is generally inconsistent. Therefore, when the user controls the same interactive object in different electronic devices, the same operation range Corresponding control effects often have certain differences.
- the interaction logic slides a logical pixel for the user's sliding operation
- the application also controls the interactive object to rotate a unit angle as an example, if the operating system/software program directly slides according to the user's sliding operation.
- the correspondence between the number of logical pixels and the unit angle directly controls the rotation of the interactive object, and in different electronic devices, the sliding angle corresponding to the sliding operation of the same physical amplitude may be different, for example, for the interactive object, in an electronic
- the interactive object may rotate 40°, and when the same 2 cm physical distance is slid across the screen of another electronic device, the interactive object may rotate 50°.
- the terminal displays the human-computer interaction application.
- the number of logical pixels corresponding to the touch operation may be corrected to achieve the terminal in different logical pixel densities.
- the effect on the interactive object is the same.
- FIG. 2 is a schematic flowchart showing the implementation of the solution shown in the embodiment of the present application.
- the logical pixel density of the touch screen is acquired after the number of logical pixels corresponding to the touch operation of the interactive object is performed in the touch screen of the terminal.
- the pixel density is used to indicate the number of logical pixels included in the unit area of the touch screen, and the number of logical pixels corresponding to the touch operation is corrected according to the logical pixel density and the reference pixel density, and finally, according to the corrected number of logical pixels.
- Interactive objects are controlled.
- the solution shown in the embodiment of the present invention does not directly control the interaction object according to the number of logical pixels corresponding to the touch operation after acquiring the number of logical pixels corresponding to the touch operation of the interactive object, but first according to the touch screen.
- the logical pixel density and the reference pixel density are corrected for the number of logical pixels corresponding to the touch operation, and the interactive object is controlled according to the corrected number of logical pixels, so that when the sliding control operation of the same physical distance is performed in any of the plurality of touch screens, Regardless of whether the logical pixel densities of these touch screens are the same, the control effect of the interactive objects is consistent.
- FIG. 3 is a flowchart of an interactive object control method, which may be used in an electronic device with a touch screen and an application for a human-computer interaction class, according to an exemplary embodiment.
- the control operation of the interactive object displayed in the program interface is implemented by a touch operation in the touch screen.
- the interactive object control method may include the following steps:
- step 301 the terminal acquires the number of logical pixels corresponding to the touch operation of the interactive object, which is executed in the touch screen of the terminal.
- the application in the terminal displays the interactive object
- the user performs a touch operation on the interactive object in the touch screen
- the touch operation event is generated after the operating system of the terminal detects the corresponding touch operation event.
- the application obtains the number of logical pixels corresponding to the touch operation according to the touch operation event.
- the number of logical pixels corresponding to the touch operation may be determined by combining an operable direction of the interactive object and a number of logical pixels through which the touch operation operation passes. Specifically, for example:
- the number of logical pixels that the touch operation passes may be obtained as the number of logical pixels corresponding to the touch operation.
- FIG. 4 is a schematic diagram of a logical pixel corresponding to a touch operation according to an embodiment of the present application.
- each square is a logical pixel
- the touch operation is a linear sliding operation
- the sliding track 41 passes through the logical pixel in the touch screen as the shaded portion pixel 42 in FIG. 4
- the operable direction of the interactive object is In the omnidirectional direction, the number of logical pixels (ie, the shaded portion pixels 42 in FIG. 4) through which the sliding track of the linear sliding operation passes can be obtained as the number of logical pixels corresponding to the touch operation.
- the number of logical pixels corresponding to the projection of the touch operation in the specified direction is obtained as the number of logical pixels corresponding to the touch operation.
- FIG. 5 is a schematic diagram of a logical pixel corresponding to a touch operation according to an embodiment of the present application.
- each square is a logical pixel
- the touch operation is a linear sliding operation.
- the sliding track 51 passes through the logical pixel in the touch screen as the shadow portion pixel 52 in FIG. 5, and the shadow portion of the shadow portion pixel 52 in the horizontal direction corresponds to the black filled portion pixel 53 in FIG. 5, when the interactive object is
- the operation direction is the horizontal direction
- the number of the black-filled partial pixels 53 can be obtained as the number of logical pixels corresponding to the touch operation.
- FIG. 6 is a schematic diagram of a logical pixel corresponding to another touch operation according to an embodiment of the present application.
- each square is a logical pixel
- the touch operation is a linear sliding operation.
- the logical pixels in the sliding track 61 passing through the touch screen are the shadow partial pixels 62 in FIG. 6, and the logical pixels corresponding to the projection of the shadow partial pixels 62 in the vertical direction are the black filled partial pixels 63 in FIG. 6, when the interactive object
- the number of the black-filled partial pixels 63 can be obtained as the number of logical pixels corresponding to the touch operation.
- Step 302 The terminal acquires a logical pixel density of the touch screen, where the logical pixel density is used to indicate the number of logical pixels included in a unit area of the touch screen.
- the logical pixel density of the touch screen can be obtained from the operating system of the terminal.
- the system attribute reading object provided by the core component can be obtained, and the core component provides support for the application corresponding to the interactive object.
- the system property reading object provides a first application programming interface (API); calling the first API to obtain a logical pixel density returned by the system property reading object, the logical pixel density is a system
- the property read object is obtained by calling the second API provided by the terminal's operating system.
- the application developed by the Unity engine cannot directly call the API provided by the operating system.
- the Unity engine can provide an object, and the object can invoke an API provided by the operating system.
- the object also provides an API externally.
- an application developed by the Unity engine calls the API provided by the object to read the system property
- the object can call the API provided by the operating system to obtain the system property, and return the obtained property to the application.
- the core component is the Unity engine
- the operating system of the terminal is the Android system.
- FIG. 7 is a schematic diagram of a logic pixel density acquisition process according to an embodiment of the present application.
- the application corresponding to the interactive object is an application 71
- the application 71 includes an input management module 71a, which is configured to manage a touch operation of the interactive object targeted by the user
- the Unity engine 72 is The application 71 provides support.
- the Unity engine 72 includes a system attribute read object 72a.
- the system attribute read object 72a may be an Android Java Object.
- the Unity engine 72 acquires the system attribute reading object 72a, and reads the logical pixel density of the touch screen by the system attribute reading object 72a to the core library 73 loaded by the Android system runtime.
- the system virtual machine 74 can read from the core library 73 through the Java virtual machine 74. Take this logical pixel density (also known as DensityDpi).
- the foregoing core component can provide an external pixel density acquisition interface, that is, the core component can obtain the physical pixel density of the screen and provide a physical pixel density query service, in some terminals.
- the physical pixel density of the touch screen is the same as the logical pixel density. Therefore, when the logical pixel density of the touch screen is the same as the physical pixel density of the touch screen, the third API provided by the core component can be directly called to obtain the physical pixel density, and the physical pixel density is obtained.
- the physical pixel density is determined as the logical pixel density.
- some third-party core components that support the application corresponding to the interactive object also provide a screen pixel density acquisition interface, and the application can obtain the screen pixel density of the electronic device by calling the screen pixel density acquisition interface, where
- the screen pixel density is typically the average of the physical pixel density xdpi of the screen of the electronic device in the x direction and the physical pixel density ydpi of the screen in the y direction.
- the screen pixel density acquisition interface provided by the Unity engine is the Screem.dpi API.
- the application can directly obtain the screen pixel density of the electronic device (also known as ScreemDpi).
- the pixel density of the screen obtained by the third-party core component is the same as the logical pixel density of the screen of the electronic device.
- the logical pixel density of the screen can be directly obtained through the API interface provided by the third-party core component.
- the core component is the Unity engine
- the operating system of the terminal is the iOS system.
- the screen pixel density of the electronic device running the iOS system is the same as the logical pixel density.
- FIG. 8 illustrates the embodiment of the present application.
- the application corresponding to the interactive object is an application 81
- the application 81 includes an input management module 81 a configured to manage a touch operation of the interactive object targeted by the user
- the Unity engine 82 is
- the application 81 provides support.
- the Unity engine 82 includes an API interface 83 for providing a ScreemDpi read function (for example, the API interface 83 can be a Screem.dpi API).
- the input management is performed.
- Module 81a obtains the screen pixel density ScreemDpi by calling the API interface and uses ScreemDpi as the logical pixel density.
- Step 303 The terminal corrects the number of logical pixels corresponding to the touch operation according to the logical pixel density and the reference pixel density.
- the product of the number of logical pixels corresponding to the touch operation and the reference pixel density may be divided by the logical pixel density to obtain the corrected number of logical pixels.
- the corresponding first correction formula is as follows:
- N is the number of corrected logical pixels
- N 1 is the number of logical pixels corresponding to the touch operation
- D 0 is the reference pixel density
- D 1 is the logical pixel density
- the reference pixel density is a pixel density set in advance, and when developing an application, the developer develops the application based on the reference pixel density.
- the reference pixel density may be a logical pixel density of a touch screen of a terminal of a certain model with a high market share.
- some human-computer interaction applications in order to be able to run on a lower performance terminal, some human-computer interaction applications also support a variety of different resolutions, so when the application supports multiple different resolutions
- the current resolution of the application needs to be considered.
- the resolution scaling factor of the interactive object may be acquired, and the resolution scaling factor is an interactive object.
- the resolution scaling factor is an interactive object.
- the number of corrected logical pixels corresponds to the ratio between the current resolution and the default resolution of the application interface, and dividing the product of the number of logical pixels corresponding to the touch operation and the reference pixel density by the logical pixel density, multiplying by the resolution scaling factor.
- the number of corrected logical pixels is as follows:
- N is the corrected number of logical pixels
- N 1 is the number of logical pixels corresponding to the touch operation
- D 0 is the reference pixel density
- D 1 is the logical pixel density
- Q is the resolution scaling factor
- some applications may support different screen resolutions, that is, the same application, in some higher performance electronic devices, the screen resolution is higher (for example, it can be 1920 ⁇ 1080), and in some lower performance electronic devices, the screen resolution may be lower (for example, it may be 1024 ⁇ 768). Therefore, for an application that supports a plurality of different screen resolutions, when the number of logical pixels corresponding to the touch operation is corrected, the screen resolution currently displayed by the application is also required to be combined, and in the embodiment of the present application, the preset is preset.
- a uniform default resolution when the number of logical pixels corresponding to the touch operation is corrected, the number of logical pixels corresponding to the touch operation is multiplied by the ratio between the current resolution of the application interface and the default resolution, that is, the difference can be eliminated.
- Step 304 The terminal controls the interaction object according to the corrected number of logical pixels.
- the rotation angle of the interaction object may be calculated according to the corrected number of logical pixels, and the interaction object is controlled to rotate according to the calculated rotation angle.
- the pixel distance of the interaction object may be calculated according to the corrected number of logical pixels, and the interaction object is controlled to move according to the calculated pixel distance.
- the method of the embodiment of the present application does not directly control the interactive object according to the number of logical pixels corresponding to the touch operation. Rather, the number of logical pixels corresponding to the touch operation is corrected according to the logical pixel density and the reference pixel density of the touch screen, and the interactive object is controlled according to the corrected number of logical pixels, so that the same physical distance is performed in any of the plurality of touch screens.
- the sliding control operation is performed, regardless of whether the logical pixel densities of these touch screens are the same, the control effect of the interactive objects is consistent.
- the number of logical pixels corresponding to the touch operation is corrected, the number of logical pixels corresponding to the touch operation is multiplied by the ratio between the current resolution and the default resolution of the application interface. , thereby eliminating the effect of different screen resolutions on the operation results of the touch operation.
- the solution shown in the foregoing embodiment of FIG. 3 can be used in various application scenarios involving touch interaction, especially in scenarios where the accuracy of touch is high, such as in an athletic game involving touch operations.
- the above method can be applied to a first-person shooting (FPS) game or an action real-time strategy (ARTS) game that relies on touch operations.
- FPS first-person shooting
- ARTS action real-time strategy
- FIG. 9 illustrates an interactive interface diagram of an exemplary embodiment.
- at least two operation areas are defined in the interface 90 of the first person shooting mobile game, including at least the mobile operation area 91 on the left side of the interface and the steering operation area 92 on the right side of the interface.
- the number of logical pixels corresponding to the sliding operation is obtained, according to the ratio between the reference pixel density and the current logical pixel density of the smart phone, and the current resolution and default of the game interface.
- the ratio between the resolutions is corrected, the number of the obtained logical pixels is corrected, the corrected number of logical pixels is obtained, and the interaction object is controlled to move according to the relationship between the corrected number of logical pixels and the moving distance of the interactive object. the distance.
- the movement of the interactive object may be embodied as the advancement and translation of the game screen relative to the virtual character.
- the number of logical pixels corresponding to the sliding operation is obtained, according to the ratio between the reference pixel density and the current logical pixel density of the smartphone, and the current resolution and default of the game interface.
- the ratio between the resolutions is corrected, the number of the obtained logical pixels is corrected, the corrected number of logical pixels is obtained, and the interaction object is controlled according to the relationship between the corrected number of logical pixels and the steering angle of the interactive object. angle.
- the rotation of the interactive object may be specifically reflected by the direction of the game screen relative to the virtual character.
- FIG. 10 illustrates an interactive interface diagram of an exemplary embodiment.
- at least two operation areas are defined in the interface 100 of the action real-time strategy mobile game, including at least the mobile operation area 101 on the left side of the interface and the operation operation area 102 on the right side of the interface.
- An interaction object 103 is also displayed in the interface 100.
- the triggering of certain conditions such as when the operation area 102 receives the touch operation
- the position of the corresponding interaction object 103 in the interface 100 is further displayed with a pointing mark 104.
- the pointing marker 104 is used to indicate the pointing of the interactive object 103 (specifically, may be the shooting direction of the interactive object 103 or the "skill" release direction, etc.).
- the number of logical pixels corresponding to the sliding operation is obtained, according to the ratio between the reference pixel density and the current logical pixel density of the smart phone, and the current resolution and default of the game interface.
- the ratio between the resolutions is corrected, the number of the obtained logical pixels is corrected, the corrected number of logical pixels is obtained, and the interactive object 103 is controlled to move according to the relationship between the corrected number of logical pixels and the moving distance of the interactive object.
- the corresponding distance may be embodied as the movement of the interactive object 103 in the game screen.
- the number of logical pixels corresponding to the sliding operation is obtained, according to the ratio between the reference pixel density and the current logical pixel density of the smart phone, and the current resolution and default of the game interface.
- the ratio between the resolutions is corrected, the number of the obtained logical pixels is corrected, the corrected number of logical pixels is obtained, and the interaction object is controlled according to the relationship between the corrected number of logical pixels and the steering angle of the interactive object. angle.
- the rotation of the interactive object may be embodied as a rotation pointing in the direction indicated by the mark 104.
- the moving distance of the interactive object is the same for the touch operation with the same operation amplitude.
- the steering angle can be consistent, thus avoiding the operational differences when the same game is run on different electronic devices.
- FIG. 11 shows a block diagram of an interactive object control apparatus according to an exemplary embodiment.
- the interactive object control device can be implemented in hardware or a combination of hardware and software as all or part of an electronic device that installs an application of the human-computer interaction type, the electronic device has a touch screen, and is displayed in an application interface of a human-computer interaction type.
- the control operation of the interactive object is implemented by a touch operation in the touch screen; for example, the electronic device may be a smart phone, a tablet computer, an e-book reader, and a professional game device with a touch screen.
- the interactive object control apparatus may include one or more processors, and one or more memories storing the program units, wherein the program units are executed by the processor, and the program units include:
- the pixel number obtaining module 1101 is configured to acquire the number of logical pixels corresponding to the touch operation of the interactive object, which is executed in the touch screen of the terminal;
- the pixel density acquisition module 1102 is configured to acquire a logical pixel density of the touch screen, where the logical pixel density is used to indicate the number of logical pixels included in a unit area of the touch screen;
- the correction module 1103 is configured to correct the number of logical pixels corresponding to the touch operation according to the logical pixel density and the reference pixel density;
- the control module 1104 is configured to control the interactive object according to the corrected number of logical pixels.
- the foregoing pixel density acquisition module includes:
- the object obtaining unit is configured to acquire a system property reading object provided by the core component, where the core component is a third-party core component that provides support for the application corresponding to the interaction object, and the system property reading object provides the first application to the external application.
- Programming interface API ;
- a first calling unit configured to invoke the first API to obtain the foregoing logical pixel density returned by the system attribute reading object, where the logical pixel density is obtained by using the second API provided by the operating system of the terminal by the system attribute reading object of.
- the pixel density acquiring module includes:
- a second calling unit configured to invoke a third API provided by the core component to obtain the physical pixel density, wherein the core component is a third-party core component that provides support for the application corresponding to the interactive object;
- the determining unit is configured to determine the acquired physical pixel density as the above logical pixel density.
- the correction module is configured to divide the product of the number of logical pixels corresponding to the touch operation and the reference pixel density by the logical pixel density to obtain the corrected number of logical pixels.
- the above correction module includes:
- a factor obtaining unit configured to obtain a resolution scaling factor of the interaction object, where the resolution scaling factor is a ratio between a current resolution and a default resolution of the application interface corresponding to the interaction object;
- the correction unit is configured to divide the product of the number of logical pixels corresponding to the touch operation and the reference pixel density by the logical pixel density, and multiply the resolution scale factor to obtain the corrected number of logical pixels.
- control module includes:
- the angle calculation unit is configured to calculate a rotation angle of the interaction object according to the corrected number of logical pixels
- the rotation control unit is configured to control the interactive object to rotate according to the calculated rotation angle obtained by the calculation.
- control module includes:
- a distance calculating unit configured to calculate a pixel distance of the moving of the interactive object according to the corrected number of logical pixels
- the movement control unit is configured to control the interaction object to move according to the pixel distance obtained by the calculation.
- the device shown in the embodiment of the present invention does not directly control the interactive object according to the number of logical pixels corresponding to the touch operation after acquiring the number of logical pixels corresponding to the touch operation of the interactive object. Rather, the number of logical pixels corresponding to the touch operation is corrected according to the logical pixel density and the reference pixel density of the touch screen, and the interactive object is controlled according to the corrected number of logical pixels, so that the same physical distance is performed in any of the plurality of touch screens.
- the sliding control operation is performed, regardless of whether the logical pixel densities of these touch screens are the same, the control effect of the interactive objects is consistent.
- the number of logical pixels corresponding to the touch operation is corrected, the number of logical pixels corresponding to the touch operation is multiplied by the ratio between the current resolution and the default resolution of the application interface. , thereby eliminating the effect of different screen resolutions on the operation results of the touch operation.
- the embodiment of the present application further provides a non-transitory computer readable storage medium including instructions, such as a storage device including instructions, which may be executed by a processor of an electronic device to perform interactive object control as shown in various embodiments of the present application.
- a non-transitory computer readable storage medium described above may be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, and an optical data storage device.
- FIG. 12 is a schematic structural diagram of an electronic device 1200 according to an exemplary embodiment.
- the electronic device 1200 in the embodiments of the present application may include one or more components that are configured to execute computer program instructions to perform various processes and methods, and are configured as information and stored program instructions for random access memory (RAM) and read only memory (ROM), which are set as memory for storing data and information, I/O devices, interfaces, antennas, and the like.
- RAM random access memory
- ROM read only memory
- the electronic device 1200 may include a radio frequency (RF) circuit 1210, a memory 1220, an input unit 1230, a display unit 1240, a sensor 1250, an audio circuit 1260, a wireless fidelity (WiFi) module 1270, a processor 1280, and a power supply. 1282, camera 1290 and other components.
- RF radio frequency
- the electronic device structure illustrated in FIG. 12 does not constitute a limitation on the electronic device, and may include more or less components than those illustrated, or a combination of certain components, or different component arrangements.
- the RF circuit 1210 can be configured to receive and transmit signals during and after the transmission or reception of information, in particular, after receiving the downlink information of the base station, and processing it to the processor 1280; in addition, transmitting the designed uplink data to the base station.
- RF circuits include, but are not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a Low Noise Amplifier (LNA), a duplexer, and the like.
- LNA Low Noise Amplifier
- RF circuitry 1210 can also communicate with the network and other devices via wireless communication.
- the above wireless communication may use any communication standard or protocol, including but not limited to Global System of Mobile communication (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (Code Division). Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), E-mail, Short Messaging Service (SMS), and the like.
- GSM Global System of Mobile communication
- GPRS General Packet
- the memory 1220 can be configured to store software programs and modules, and the processor 1280 executes various functional applications and data processing of the electronic device 1200 by running software programs and modules stored in the memory 1220.
- the memory 1220 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application required for at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may be stored according to The data created by the use of the electronic device 1200 (such as audio data, phone book, etc.) and the like.
- memory 1220 can include high speed random access memory, and can also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
- the input unit 1230 can be configured to receive input numeric or character information and to generate key signal inputs related to user settings and function control of the electronic device 1200.
- the input unit 1230 may include a touch panel 1231 and other input devices 1232.
- the touch panel 1231 also referred to as a touch screen, can collect touch operations on or near the user (such as the user using a finger, a stylus, or the like on the touch panel 1231 or near the touch panel 1231. Operation), and drive the corresponding connecting device according to a preset program.
- the touch panel 1231 may include two parts: a touch detection device and a touch controller.
- the touch detection device detects the touch orientation of the user, and detects a signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts the touch information into contact coordinates, and sends the touch information.
- the processor 1280 is provided and can receive commands from the processor 1280 and execute them.
- the touch panel 1231 can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic waves.
- the input unit 1230 may also include other input devices 1232.
- other input devices 1232 may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control buttons, switch buttons, etc.), trackballs, mice, joysticks, and the like.
- the display unit 1240 can be configured to display information input by the user or information provided to the user and various menus of the electronic device 1200.
- the display unit 1240 can include a display panel 1241.
- the display panel 1241 can be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), or the like.
- the touch panel 1231 covers the display panel 1241. When the touch panel 1231 detects a touch operation thereon or nearby, the touch panel 1231 transmits to the processor 1280 to determine the type of the touch event, and then the processor 1280 according to the type of the touch event. A corresponding visual output is provided on display panel 1241.
- the touch panel 1231 and the display panel 1241 are used as two independent components to implement the input and input functions of the electronic device 1200, in some embodiments, the touch panel 1231 and the display panel 1241 may be The input and output functions of the electronic device 1200 are implemented integrated.
- Electronic device 1200 may also include at least one type of sensor 1250, such as a gyro sensor, a magnetic induction sensor, a light sensor, a motion sensor, and other sensors.
- the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display panel 1241 according to the brightness of the ambient light, and the proximity sensor may close the display panel 1241 when the electronic device 1200 moves to the ear. And / or backlight.
- the acceleration sensor can detect the magnitude of acceleration in each direction (usually three axes). When it is stationary, it can detect the magnitude and direction of gravity. It can be set to identify the position of the electronic device (such as horizontal and vertical screen switching).
- the electronic device 1200 can also be configured with barometers, hygrometers, thermometers, infrared sensors and other sensors, here Let me repeat.
- Audio circuitry 1260, speaker 1281, and microphone 1262 can provide an audio interface between the user and electronic device 1200.
- the audio circuit 1260 can transmit the converted electrical data of the received audio data to the speaker 1261, and convert it into a sound signal output by the speaker 1261; on the other hand, the microphone 1262 converts the collected sound signal into an electrical signal, by the audio circuit 1260. After receiving, it is converted into audio data, and then processed by the audio data output processor 1280, transmitted to the electronic device such as another electronic device via the RF circuit 1210, or outputted to the memory 1220 for further processing.
- WiFi is a short-range wireless transmission technology
- the electronic device 1200 can help users to send and receive emails, browse web pages, and access streaming media through the WiFi module 1270, which provides wireless broadband Internet access for users.
- FIG. 12 shows the WiFi module 1270, it can be understood that it does not belong to the essential configuration of the electronic device 1200, and may be omitted as needed within the scope of not changing the essence of the disclosure.
- the processor 1280 is a control center of the electronic device 1200 that connects various portions of the entire electronic device using various interfaces and lines, by running or executing software programs and/or modules stored in the memory 1220, and recalling stored in the memory 1220.
- the processor 1280 may include one or more processing units; preferably, the processor 1280 may integrate an application processor and a modem processor, where the application processor mainly processes an operating system, a user interface, an application, and the like.
- the modem processor primarily handles wireless communications. It will be appreciated that the above described modem processor may also not be integrated into the processor 1280.
- the electronic device 1200 also includes a power source 1282 (such as a battery) for powering various components.
- a power source 1282 (such as a battery) for powering various components.
- the power source can be logically coupled to the processor 1280 through a power management system to manage functions such as charging, discharging, and power management through the power management system. .
- the camera 1290 generally consists of a lens, an image sensor, an interface, a digital signal processor, a CPU, a display screen, and the like.
- the lens is fixed above the image sensor, and the focus can be changed by manually adjusting the lens;
- the image sensor is equivalent to the "film" of the conventional camera, and is the heart of the image captured by the camera;
- the interface is set to use the cable, the board to the board
- the connector and the spring-type connection method are connected to the electronic device main board, and the collected image is sent to the above-mentioned memory 1220;
- the digital signal processor processes the acquired image through mathematical operations, converts the collected analog image into a digital image, and transmits the image through the interface.
- To memory 1220 To memory 1220.
- the electronic device 1200 may further include a Bluetooth module or the like, and details are not described herein again.
- the electronic device 1200 includes, in addition to the one or more processors 1280, a memory, and one or more modules, wherein one or more modules are stored in the memory and configured to be executed by one or more processors to All or part of the steps in the method shown in Figure 3 above are implemented.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Human Computer Interaction (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Software Systems (AREA)
- User Interface Of Digital Computer (AREA)
Abstract
本申请实施例是关于一种交互对象控制方法、装置、终端及计算机可读存储介质,属于人机交互技术领域。该方法包括:终端获取在该终端的触摸屏中执行的,针对交互对象的触控操作对应的逻辑像素数量;终端获取触摸屏的逻辑像素密度;终端根据逻辑像素密度以及基准像素密度对触控操作对应的逻辑像素数量进行修正;终端根据修正后的逻辑像素数量对交互对象进行控制;该方法,在获取到针对交互对象的触控操作对应的逻辑像素数量后,先根据触摸屏的逻辑像素密度和基准像素密度对该触控操作对应的逻辑像素数量进行修正,并按照修正后的逻辑像素数量控制交互对象,使得在任意触摸屏中进行同样物理距离的滑动控制操作时,最终对交互对象的控制效果保持一致。
Description
本申请要求于2017年08月08日提交中国专利局、申请号为201710668854.0、发明名称“交互对象控制方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
本申请实施例涉及人机交互技术领域,特别涉及一种交互对象控制方法、装置、终端及计算机可读存储介质。
随着触摸屏技术的不断发展,触摸屏的触控精度和易用性也越来越高,相应的,市面上通过触控操作进行人机交互的应用程序也越来越多,在一种典型的人机交互应用中,在可以通过在触摸屏上的触控操作控制应用程序界面中显示的交互对象。
在相关技术中,对于控制精度要求较高的应用,通常根据用户的触控操作对应的逻辑像素的数量来控制交互对象的动作。比如,以通过用户在触摸屏上的滑动操作来控制交互对象为例,终端检测到用户的滑动操作后,获取该滑动操作对应的逻辑像素数量,根据逻辑像素数量与动作幅度之间的关系计算交互对象的动作幅度,并根据计算得到的动作幅度控制交互对象做出相应的动作。
在实际应用中,对于不同型号的终端,其触摸屏上的逻辑像素密度通常是不一样的,即在不同的触摸屏上,相同物理距离的滑动操作所对应的逻辑像素数量通常是不同的,这就导致对于同一交互对象,用户在不同型号终端的触摸屏上进行相同的操作时,对交互对象的控制效果通常不相同。
发明内容
为了解决相关技术中对于同一交互对象,用户在不同型号终端的触摸屏上进行相同的操作时,对交互对象的控制效果通常不相同的问题,本申请实施例提供了一种交互对象控制方法、装置、终端及计算机可读存储介 质,技术方案如下:
第一方面,提供了一种交互对象控制方法,上述方法包括:
终端获取在终端的触摸屏中执行的,针对交互对象的触控操作对应的逻辑像素数量;
上述终端获取上述触摸屏的逻辑像素密度,上述逻辑像素密度用于指示上述触摸屏中单位面积内包含的逻辑像素数量;
上述终端根据上述逻辑像素密度以及基准像素密度对上述触控操作对应的逻辑像素数量进行修正;
上述终端根据修正后的逻辑像素数量对上述交互对象进行控制。
第二方面,提供了一种交互对象控制装置,上述装置包括一个或多个处理器,以及一个或多个存储程序单元的存储器,其中,上述程序单元由上述处理器执行,上述程序单元包括:
像素数量获取模块,被设置为获取在终端的触摸屏中执行的,针对交互对象的触控操作对应的逻辑像素数量;
像素密度获取模块,被设置为获取上述触摸屏的逻辑像素密度,上述逻辑像素密度用于指示上述触摸屏中单位面积内包含的逻辑像素数量;
修正模块,被设置为根据上述逻辑像素密度以及基准像素密度对上述触控操作对应的逻辑像素数量进行修正;
控制模块,被设置为根据修正后的逻辑像素数量对上述交互对象进行控制。
第三方面,提供了一种计算机可读存储介质,其中存储有多条指令,上述指令适于由处理器加载并执行:
获取在终端的触摸屏中执行的,针对交互对象的触控操作对应的逻辑像素数量;
获取上述触摸屏的逻辑像素密度,上述逻辑像素密度用于指示上述触摸屏中单位面积内包含的逻辑像素数量;
根据上述逻辑像素密度以及基准像素密度对上述触控操作对应的逻辑像素数量进行修正;
根据修正后的逻辑像素数量对上述交互对象进行控制。
第四方面,提供了一种终端,上述终端包括处理器和存储器,存储器中存储有至少一条指令,上述至少一条指令由处理器加载并执行以实现本申请实施例的交互对象控制方法。
本申请实施例提供的技术方案可以包括以下有益效果:
在获取到针对交互对象的触控操作对应的逻辑像素数量后,先根据触摸屏的逻辑像素密度和基准像素密度对该触控操作对应的逻辑像素数量进行修正,并按照修正后的逻辑像素数量控制交互对象,使得在任意触摸屏中进行同样物理距离的滑动控制操作时,最终对交互对象的控制效果保持一致。
应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,并不能限制本申请实施例。
此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本申请的实施例,并与说明书一起用于解释本申请实施例的原理。
图1A是本申请实施例提供的一种人机交互操作示意图;
图1B是本申请各个实施例涉及的逻辑像素与物理像素的对应示意图;
图2是本申请一实施例所示方案的实现流程示意图;
图3是根据本申请一示例性实施例示出的一种交互对象控制方法的流程图;
图4是图3所示实施例涉及的一种触控操作对应的逻辑像素示意图;
图5是图3所示实施例涉及的另一种触控操作对应的逻辑像素示意图;
图6是图3所示实施例涉及的另一种触控操作对应的逻辑像素示意图;
图7是图3所示实施例涉及的一种逻辑像素密度获取流程示意图;
图8是图3所示实施例涉及的另一种逻辑像素密度获取流程示意图;
图9是根据本申请一示例性实施例示出的一种交互界面示意图;
图10是根据本申请一示例性实施例示出的另一种交互界面示意图;
图11是根据本申请一示例性实施例示出的一种交互对象控制装置的 框图;
图12是根据本申请一示例性实施例提供的电子设备的结构示意图。
这里将详细地对示例性实施例进行说明,其示例表示在附图中。下面的描述涉及附图时,除非另有表示,不同附图中的相同数字表示相同或相似的要素。以下示例性实施例中所描述的实施方式并不代表与本申请相一致的所有实施方式。相反,它们仅是与如所附权利要求书中所详述的、本申请实施例的一些方面相一致的装置和方法的例子。
本申请各个实施例所示的方案可以应用于安装有人机交互类的应用程序的电子设备中,该电子设备具有触摸屏,且对人机交互类的应用程序界面中显示的交互对象的控制操作通过在触摸屏中的触控操作来实现。比如,该电子设备可以是智能手机、平板电脑、电子书阅读器以及带有触摸屏的专业游戏设备等。
以电子设备为智能手机为例,请参考图1A,其示出了一种人机交互操作示意图。如图1A所示,在某第一人称射击类游戏(First-person shooting game,FPS)应用程序的应用界面101中,左侧区域为移动操作区,右侧区域为瞄准/转向操作区,用户双手握持智能手机,用户左手102的手指在移动操作区内进行滑动触控操作,以控制应用界面101中交互对象移动(在FPS应用程序的界面中体现为场景的移动),移动距离与用户的手指在移动操作区内的滑动距离有关;用户右手103的手指在瞄准/转向操作区内进行滑动触控操作,以控制应用界面101中的交互对象转动(在FPS应用程序的界面中体现为视角的转动),转动角度与手指在瞄准/转向操作区内的滑动距离有关。
在介绍本申请各个实施例的方案之前,首先对本申请各个实施例涉及到的名词进行解释说明:
1)像素。
像素,又称图像元素(pixel,px),是分辨率的尺寸单位,在电子设备中,通常以像素每英寸(pixels per inch,PPI)或者像素点每英寸(dots per inch,DPI)为单位来表示分辨率的大小。例如300x300PPI的分辨率,即表示水平方向与垂直方向上每英寸长度上的像素点数都是300,也可表示为一平方英寸内有9万(即300x300)像素。
2)物理像素、物理像素密度和物理分辨率。
像素有物理像素(physical pixel)和逻辑像素(logical pixel)之分。其中,物理像素又称设备像素(device pixel)或者硬件像素,其由电子设备的屏幕硬件决定。每个物理像素是电子设备的屏幕中,能够控制显示的最小单位。以电子设备的屏幕为发光二极管(Light Emitting Diode,LED)液晶屏幕为例,LED液晶屏幕的液晶板上以网格形式来划分液晶体,若电子设备可以对每一个液晶体单独进行控制显示,则该液晶板上每一个液晶体即为一个物理像素。
电子设备屏幕的物理像素数量决定了屏幕的物理像素密度和物理分辨率(或者称为硬件分辨率),比如,某个电子设备的屏幕的物理分辨率是为1024×768时,就是指屏幕在横向上划分了1024个物理像素,竖向上划分了768个物理像素,而物理像素密度就是在屏幕中,每英寸距离上排列多少个物理像素点,或者,在每平方英寸中包含多少个物理像素点。
3)逻辑像素、逻辑像素密度和逻辑分辨率。
随着移动设备的屏幕的PPI不断增加,对于开发者来说,使用物理像素来度量显示元素的方式在软件开发过程中遇到的困难也越来越多,比如,不同终端的屏幕的物理分辨率存在不一致的情况,如果使用物理像素来度量显示元素,则会导致开发出的软件程序无法匹配不同屏幕的终端的情况,而逻辑像素就是为了解决上面的问题而提取出的一个抽象概念。
逻辑像素由电子设备的系统软件决定,每个逻辑像素可以看作是屏幕的显示区域中,软件程序可以控制显示的最小区域。不同的平台对与逻辑像素的字面定义也有所不同,比如,iOS平台中,逻辑像素称为显示点(Point,PT),而在Android平台中,逻辑像素称为设备无关像素(Device independent Pixel,DP或DiP)。
电子设备的屏幕的逻辑像素密度以及逻辑分辨率(又称为屏幕分辨率)取决于系统软件当前对屏幕中的显示区域的逻辑像素的划分。比如,某个电子设备的屏幕的逻辑分辨率是为1024×768时,就是指系统软件在屏幕 的显示区域中横向划分了1024个逻辑像素,竖向上划分了768个逻辑像素。而逻辑像素密度就是在屏幕中,每英寸距离上排列多少个逻辑像素点,或者,在每平方英寸中包含多少个逻辑像素点。
电子设备的系统软件在划分逻辑像素时,可以将一个物理像素对应的显示区域划分为一个逻辑像素,或者,也可以将多个物理像素对应的显示区域划分为一个逻辑像素。
电子设备的屏幕的逻辑像素是软件可调的,在实际应用中,当用户调节电子设备的屏幕分辨率时,该电子设备的屏幕中显示画面时的逻辑像素也随之改变,其中,电子设备的屏幕分辨率通常有1920×1080、1600×900、1440×900、1024×768以及1366×768等几种;另一种情况下,当终端对屏幕当前显示的画面进行手动缩放,比如缩放一幅逻辑分辨率固定的图片时,该图片中每个逻辑像素的大小也会随着缩放倍数而改变。
比如,请参考图1B,其示出了本申请各个实施例涉及的逻辑像素与物理像素的对应示意图,假设终端的屏幕的物理分辨率为1920×1080,终端的系统所支持的最大逻辑分辨率也为1920×1080,在图1B中,每个实线框为表示一个物理像素,每个虚线框表示一个逻辑像素,当终端以1920×1080的分辨率显示一幅图片时,该图片中每个像素(即逻辑像素)对应一个物理像素,在图1B(a)中表示为一个实线框对应一个虚线框;当用户对图片进行4倍放大后,图像的显示分辨率(也即逻辑分辨率)不变,而每个逻辑像素对应的显示区域对应4个物理像素的区域,即在图1B(b)中表示为四个实线框对应一个虚线框。
对于具有触摸屏的电子设备,用户在触摸屏上进行触控操作时,电子设备的操作系统/软件程序检测用户的触控操作的操作幅度,是以逻辑像素为单位进行衡量的,比如,用户在触摸屏上执行一个滑动操作时,电子设备的操作系统/软件程序获取到的操作信息中,用以衡量用户的滑动幅度的信息是该滑动操作经过了屏幕中的多少个逻辑像素,并且,操作系统/软件程序也是根据该滑动操作经过的逻辑像素的数量来对交互对象进行控制。而对于不同型号的电子设备的触摸屏,在相同的物理距离上对应的逻辑像素的数量通常是不一致的,因此,当用户在不同的电子设备中对同一个交 互对象进行控制时,相同的操作幅度对应的控制效果往往存在一定的差别。
比如,以交互对象为可转动对象,交互逻辑为用户的滑动操作每滑过一个逻辑像素,应用程序也控制交互对象转动一个单位角度为例,若操作系统/软件程序直接按照用户的滑动操作滑过的逻辑像素数量与单位角度之间的对应关系直接控制交互对象转动,则在不同的电子设备中,同样物理幅度的滑动操作对应的转动角度可能不同,比如,对于上述交互对象,在一个电子设备的屏幕中滑过2cm的物理距离时,交互对象可能转动40°,而在另一个电子设备的屏幕中滑过同样的2cm的物理距离时,交互对象可能会转动50°。
为了避免在不同的电子设备的屏幕中执行同样幅度的触控操作,而对交互对象的控制效果不同的情况,在本申请各个实施例所示的方案中,终端展示人机交互类的应用程序时,接收到用户在触摸屏中执行的,针对应用程序显示界面中的交互对象的触控操作时,可以对触控操作对应的逻辑像素数量进行修正,以达到在不同的逻辑像素密度的终端中滑过同样的距离时,对交互对象的操作效果相同的目的。
具体的,请参考图2,其示出了本申请实施例所示方案的实现流程示意图。如图2所示,在运行人机交互类的应用程序时,获取在终端的触摸屏中执行的,针对交互对象的触控操作对应的逻辑像素数量后,获取该触摸屏的逻辑像素密度,该逻辑像素密度用于指示该触摸屏中单位面积内包含的逻辑像素数量,并根据该逻辑像素密度以及基准像素密度对该触控操作对应的逻辑像素数量进行修正,最后根据修正后的逻辑像素数量对该交互对象进行控制。
本申请实施例所示的方案,在获取到针对交互对象的触控操作对应的逻辑像素数量后,并不直接根据该触控操作对应的逻辑像素数量对交互对象进行控制,而是先根据触摸屏的逻辑像素密度和基准像素密度对该触控操作对应的逻辑像素数量进行修正,并按照修正后的逻辑像素数量控制交互对象,使得在任意多个触摸屏中进行同样物理距离的滑动控制操作时,无论这些触摸屏的逻辑像素密度是否相同,最终对交互对象的控制效果都保持一致。
图3是根据一示例性实施例示出的一种交互对象控制方法的流程图,该方法可以用于安装有人机交互类的应用程序且具有触摸屏的电子设备中,且对人机交互类的应用程序界面中显示的交互对象的控制操作通过在触摸屏中的触控操作来实现。如图3所示,该交互对象控制方法可以包括如下几个步骤:
步骤301,终端获取在该终端的触摸屏中执行的,针对交互对象的触控操作对应的逻辑像素数量。
在本申请实施例中,终端中的应用程序在展示交互对象时,用户在触摸屏中执行针对交互对象的触控操作,终端的操作系统检测到相应的触控操作事件后,将触控操作事件发送给应用程序,应用程序根据该触控操作事件获取上述触控操作对应的逻辑像素数量。
可选的,上述触控操作对应的逻辑像素数量,可以结合交互对象的可操作方向以及该触控操作操作经过的逻辑像素数量来确定。具体比如:
1)当交互对象的可操作方向为全方向时,可以将上述触控操作经过的逻辑像素数量获取为上述触控操作对应的逻辑像素数量。
具体的,请参考图4,其示出了本申请实施例涉及的一种触控操作对应的逻辑像素示意图。在图4中,每个方格为一个逻辑像素,触控操作为直线滑动操作,其滑动轨迹41经过触摸屏中的逻辑像素为图4中的阴影部分像素42,当交互对象的可操作方向为全方向时,可以将直线滑动操作的滑动轨迹经过的逻辑像素(即图4中阴影部分像素42)的数量获取为触控操作对应的逻辑像素数量。
2)当交互对象的可操作方向为指定方向时,将上述触控操作在指定方向上的投影所对应的逻辑像素数量获取为上述触控操作对应的逻辑像素数量。
比如,请参考图5,其示出了本申请实施例涉及的一种触控操作对应的逻辑像素示意图,在图5中,每个方格为一个逻辑像素,触控操作为直线滑动操作,其滑动轨迹51经过触摸屏中的逻辑像素为图5中的阴影部分像素52,阴影部分像素52在水平方向上的投影对应的逻辑像素为图5中的黑色填充部分像素53,当交互对象的可操作方向为水平方向时,可以将上述黑色填充部分像素53的数量获取为触控操作对应的逻辑像素数量。
或者,请参考图6,其示出了本申请实施例涉及的另一种触控操作对应的逻辑像素示意图,在图6中,每个方格为一个逻辑像素,触控操作为直线滑动操作,其滑动轨迹61经过触摸屏中的逻辑像素为图6中的阴影部分像素62,阴影部分像素62在垂直方向上的投影对应的逻辑像素为图6中的黑色填充部分像素63,当交互对象的可操作方向为垂直方向时,可以将上述黑色填充部分像素63的数量获取为触控操作对应的逻辑像素数量。
步骤302,终端获取该触摸屏的逻辑像素密度,该逻辑像素密度用于指示该触摸屏中单位面积内包含的逻辑像素数量。
在本申请实施例中,触摸屏的逻辑像素密度可以向终端的操作系统获取,具体的,可以获取核心组件提供的系统属性读取对象,该核心组件是对该交互对象对应的应用程序提供支持的第三方核心组件,该系统属性读取对象对外提供第一应用程序编程接口(Application Programming Interface,API);调用该第一API获取系统属性读取对象返回的逻辑像素密度,该逻辑像素密度是系统属性读取对象调用终端的操作系统提供的第二API获得的。
比如,在安卓系统中,基于Unity引擎开发的应用程序无法直接调用操作系统提供的API,在本申请实施例中,Unity引擎可以提供一个对象,该对象可以调用操作系统提供的API,同时,该对象还对外提供API,当一个基于Unity引擎开发的应用程序调用该对象提供的API来读取系统属性时,该对象可以调用操作系统提供的API来获取系统属性,并将获取到的属性返回给应用程序。
具体比如,以核心组件为Unity引擎,终端的操作系统为安卓系统为例,请参考图7,其示出了本申请实施例涉及的一种逻辑像素密度获取流程示意图。在图7中,交互对象对应的应用程序为应用程序71,该应用程序71中包含输入管理模块71a,该输入管理模块71a被设置为管理用户针对的交互对象的触控操作,Unity引擎72为应用程序71提供支持,该Unity引擎72中包含系统属性读取对象72a,该系统属性读取对象72a可以是AndroidJavaObject,接收到用户对交互对象的触控操作时,输入管理模块71a通过反射方式向Unity引擎72获取系统属性读取对象72a,通过系统 属性读取对象72a向安卓系统运行时加载的核心库73读取触摸屏的逻辑像素密度,具体的,可以通过Java虚拟机74从核心库73读取该逻辑像素密度(也可以称为DensityDpi)。
在另一种可能的实现方式中,上述核心组件可以对外提供物理像素密度的获取接口,即核心组件可以自行获取屏幕的物理像素密度,并对外提供物理像素密度的查询服务,在某些终端中,触摸屏的物理像素密度与逻辑像素密度是相同的,因此,对于触摸屏的逻辑像素密度与触摸屏的物理像素密度相同时,可以直接调用核心组件提供的第三API获取物理像素密度,并将获取到的物理像素密度确定为逻辑像素密度。
在实际应用中,某些对交互对象对应的应用程序提供支持的第三方核心组件也对外提供屏幕像素密度获取接口,应用程序可以通过调用屏幕像素密度获取接口获取电子设备的屏幕像素密度,其中,该屏幕像素密度通常是电子设备的屏幕在x方向上的物理像素密度xdpi和屏幕在y方向上的物理像素密度ydpi的均值。比如,Unity引擎对外提供的屏幕像素密度获取接口为Screem.dpi API,通过调用Screem.dpi API,应用程序可以直接获得电子设备的屏幕像素密度(也称为ScreemDpi)。在某些电子设备中,通过第三方核心组件获取到的屏幕像素密度与该电子设备的屏幕的逻辑像素密度相同,此时,为了更快的获取到电子设备的屏幕的逻辑像素密度,以提高对触控操作的响应速度,当电子设备的屏幕像素密度与该电子设备的屏幕的逻辑像素密度相同时,可以通过第三方核心组件提供的API接口直接获取到屏幕的逻辑像素密度。
比如,以核心组件为Unity引擎,终端的操作系统为iOS系统为例,运行iOS系统的电子设备的屏幕像素密度与逻辑像素密度相同,请参考图8,其示出了本申请实施例涉及的一种逻辑像素密度获取流程示意图。在图8中,交互对象对应的应用程序为应用程序81,该应用程序81中包含输入管理模块81a,该输入管理模块81a被设置为管理用户针对的交互对象的触控操作,Unity引擎82为应用程序81提供支持,该Unity引擎82中包含对外提供ScreemDpi读取功能的API接口83(比如,API接口83可以为Screem.dpi API),接收到用户对交互对象的触控操作时,输入管理模块81a通过调用API接口获取到屏幕像素密度ScreemDpi,并将 ScreemDpi作为逻辑像素密度。
步骤303,终端根据该逻辑像素密度以及基准像素密度对该触控操作对应的逻辑像素数量进行修正。
在本申请实施例中,在对触控操作对应的逻辑像素数量进行修正时,可以将触控操作对应的逻辑像素数量与基准像素密度的乘积除以逻辑像素密度,获得修正后的逻辑像素数量。对应的第一修正公式如下:
其中,N为修正后的逻辑像素数量,N
1为触控操作对应的逻辑像素数量,D
0为基准像素密度,D
1为逻辑像素密度。
其中,基准像素密度是预先设置的一个像素密度,开发人员在开发应用程序时,以该基准像素密度为准进行应用程序的开发。其中,该基准像素密度可以是市面上占有率较高的某个型号的终端的触摸屏的逻辑像素密度。
通过上述对触控操作对应的逻辑像素数量的修正,后续在根据修正后的逻辑像素数量对交互对象进行控制时,对于同一款应用程序,在不同的触控屏幕上,同样的物理距离对应的触控操作对应的修正后的逻辑像素数量应该是相同的,相应的,对交互对象的控制效果也相同。
在另一种可能的实现方式中,为了能够在性能较低的终端上运行,一些人机交互类的应用程序还支持多种不同的分辨率,因此,当应用程序支持多种不同分辨率时,在对触控操作对应的逻辑像素数量进行修正时,还需要考虑应用程序的当前分辨率,具体的,在进行修正时,可以获取交互对象的分辨率缩放因子,分辨率缩放因子是交互对象对应的应用程序界面的当前分辨率与默认分辨率之间的比值,并将触控操作对应的逻辑像素数量与基准像素密度的乘积除以逻辑像素密度后,乘以该分辨率缩放因子,获得修正后的逻辑像素数量。对应的第二修正公式如下:
其中,N为修正后的逻辑像素数量,N
1为触控操作对应的逻辑像素数 量,D
0为基准像素密度,D
1为逻辑像素密度,Q为分辨率缩放因子。
在实际应用中,为了兼容不同处理性能的电子设备,某些应用程序可能支持不同的屏幕分辨率,即同一款应用程序,在某些性能较高的电子设备中,其屏幕分辨率较高(比如可以是1920×1080),而在某些性能较低的电子设备中,其屏幕分辨率可能较低(比如可以是1024×768)。因此,对于支持多种不同的屏幕分辨率的应用程序,在对触控操作对应逻辑像素数量进行修正时,还需要结合考虑应用程序当前显示的屏幕分辨率,在本申请实施例中,预先设置一个统一的默认分辨率,在对触控操作对应逻辑像素数量进行修正时,对触控操作对应逻辑像素数量乘以应用程序界面的当前分辨率与默认分辨率之间的比值,即可以消除不同屏幕分辨率对触控操作的操作结果的影响。
步骤304,终端根据修正后的逻辑像素数量对该交互对象进行控制。
其中,在对交互对象进行转动控制时,可以根据修正后的逻辑像素数量计算交互对象的转动角度,根据计算获得的转动角度,控制交互对象进行转动。
或者,在对交互对象进行移动控制时,可以根据修正后的逻辑像素数量计算交互对象移动的像素距离,根据计算获得的像素距离,控制交互对象进行移动。
综上所述,本申请实施例所示的方法,在获取到针对交互对象的触控操作对应的逻辑像素数量后,并不直接根据该触控操作对应的逻辑像素数量对交互对象进行控制,而是先根据触摸屏的逻辑像素密度和基准像素密度对该触控操作对应的逻辑像素数量进行修正,并按照修正后的逻辑像素数量控制交互对象,使得在任意多个触摸屏中进行同样物理距离的滑动控制操作时,无论这些触摸屏的逻辑像素密度是否相同,最终对交互对象的控制效果都保持一致。
此外,本申请实施例所示的方法,在对触控操作对应的逻辑像素数量进行修正时,对触控操作对应逻辑像素数量乘以应用程序界面的当前分辨率与默认分辨率之间的比值,从而消除不同屏幕分辨率对触控操作的操作结果的影响。
上述图3对应的实施例所示的方案,可以用于各种涉及触摸交互的应用场景,尤其是对触控的精确度要求较高的场景,比如涉及触控操作的竞技类游戏中。典型的,上述方法可以应用于依赖触控操作的第一人称射击(first-person shooting,FPS)游戏或者动作即时策略(action real-time strategy,ARTS)游戏中。
比如,以上述方案应用于智能手机中运行的第一人称射击类手机游戏为例,请参考图9,其示出了一示例性实施例示出的一种交互界面示意图。如图9所示,第一人称射击类手机游戏的界面90中划分出至少两块操作区域,至少包括界面左侧的移动操作区91以及界面右侧的转向操作区92。
当智能手机检测到移动操作区91中的滑动操作时,获取该滑动操作对应的逻辑像素数量,根据基准像素密度与智能手机当前的逻辑像素密度之间的比值,以及游戏界面当前分辨率与默认分辨率之间的比值,对获取到的逻辑像素数量进行修正,获得修正后的逻辑像素数量,并根据修正后的逻辑像素数量与交互对象的移动距离之间的关系,控制交互对象进行移动相应的距离。其中,在图9所示的游戏界面中,交互对象的移动具体可以体现为游戏画面相对于虚拟人物的推进和平移。
当智能手机检测到转向操作区92中的滑动操作时,获取该滑动操作对应的逻辑像素数量,根据基准像素密度与智能手机当前的逻辑像素密度之间的比值,以及游戏界面当前分辨率与默认分辨率之间的比值,对获取到的逻辑像素数量进行修正,获得修正后的逻辑像素数量,并根据修正后的逻辑像素数量与交互对象的转向角度之间的关系,控制交互对象转动相应的角度。其中,在图9所示的游戏界面中,交互对象的转动具体可以体现为游戏画面相对于虚拟人物的方向转动。
再比如,以上述方案应用于智能手机中运行的动作即时策略类手机游戏为例,请参考图10,其示出了一示例性实施例示出的一种交互界面示意图。如图10所示,动作即时策略类手机游戏的界面100中划分出至少两块操作区域,至少包括界面左侧的移动操作区101以及界面右侧的指向操作区102。该界面100中还显示有交互对象103,在某些条件的触发下(比如指向操作区102接收到触控操作时),该界面100中对应交互对象103的位置还显示有指向标记104,该指向标记104用于指示该交互对象103 的指向(具体可以是交互对象103的射击方向或者“技能”释放方向等)。
当智能手机检测到移动操作区101中的滑动操作时,获取该滑动操作对应的逻辑像素数量,根据基准像素密度与智能手机当前的逻辑像素密度之间的比值,以及游戏界面当前分辨率与默认分辨率之间的比值,对获取到的逻辑像素数量进行修正,获得修正后的逻辑像素数量,并根据修正后的逻辑像素数量与交互对象的移动距离之间的关系,控制交互对象103进行移动相应的距离。其中,在图10所示的游戏界面中,交互对象的移动具体可以体现为交互对象103在游戏画面中的移动。
当智能手机检测到指向操作区102中的滑动操作时,获取该滑动操作对应的逻辑像素数量,根据基准像素密度与智能手机当前的逻辑像素密度之间的比值,以及游戏界面当前分辨率与默认分辨率之间的比值,对获取到的逻辑像素数量进行修正,获得修正后的逻辑像素数量,并根据修正后的逻辑像素数量与交互对象的转向角度之间的关系,控制交互对象转动相应的角度。其中,在图10所示的游戏界面中,交互对象的转动可以体现为指向标记104所指方向的转动。
通过上述方案,在触摸屏的尺寸或者逻辑像素密度不同的屏幕对应的电子设备中运行同一款第一人称射击类或者动作即时策略类手机游戏时,对于操作幅度相同的触控操作,交互对象的移动距离或者转向角度也能够保持一致,从而避免了同一款游戏在不同的电子设备上运行时的操作差异。
下述为本申请装置实施例,可以用于执行本申请方法实施例。对于本申请装置实施例中未披露的细节,请参照本申请方法实施例。
请参考图11,其示出了一示例性实施例示出的一种交互对象控制装置的框图。该交互对象控制装置可以通过硬件或者软硬结合的方式实现为安装有人机交互类的应用程序的电子设备的全部或者部分,该电子设备具有触摸屏,且对人机交互类的应用程序界面中显示的交互对象的控制操作通过在触摸屏中的触控操作来实现;比如,该电子设备可以是智能手机、平板电脑、电子书阅读器以及带有触摸屏的专业游戏设备等。该交互对象控制装置可以包括一个或多个处理器,以及一个或多个存储程序单元的存储器,其中,上述程序单元由上述处理器执行,上述程序单元包括:
像素数量获取模块1101,被设置为获取在终端的触摸屏中执行的,针对交互对象的触控操作对应的逻辑像素数量;
像素密度获取模块1102,被设置为获取上述触摸屏的逻辑像素密度,上述逻辑像素密度用于指示上述触摸屏中单位面积内包含的逻辑像素数量;
修正模块1103,被设置为根据上述逻辑像素密度以及基准像素密度对上述触控操作对应的逻辑像素数量进行修正;
控制模块1104,被设置为根据修正后的逻辑像素数量对上述交互对象进行控制。
可选的,上述像素密度获取模块,包括:
对象获取单元,被设置为获取核心组件提供的系统属性读取对象,上述核心组件是对上述交互对象对应的应用程序提供支持的第三方核心组件,上述系统属性读取对象对外提供第一应用程序编程接口API;
第一调用单元,被设置为调用上述第一API获取上述系统属性读取对象返回的上述逻辑像素密度,上述逻辑像素密度是上述系统属性读取对象调用上述终端的操作系统提供的第二API获得的。
可选的,当上述触摸屏的逻辑像素密度与上述触摸屏的物理像素密度相同时,上述像素密度获取模块,包括:
第二调用单元,被设置为调用核心组件提供的第三API获取上述物理像素密度,上述核心组件是对上述交互对象对应的应用程序提供支持的第三方核心组件;
确定单元,被设置为将获取到的上述物理像素密度确定为上述逻辑像素密度。
可选的,上述修正模块,被设置为将上述触控操作对应的逻辑像素数量与上述基准像素密度的乘积除以上述逻辑像素密度,获得修正后的逻辑像素数量。
可选的,上述修正模块,包括:
因子获取单元,被设置为获取上述交互对象的分辨率缩放因子,上述分辨率缩放因子是上述交互对象对应的应用程序界面的当前分辨率与默认分辨率之间的比值;
修正单元,被设置为将上述触控操作对应的逻辑像素数量与上述基准像素密度的乘积除以上述逻辑像素密度后,乘以上述分辨率缩放因子,获得修正后的逻辑像素数量。
可选的,上述控制模块,包括:
角度计算单元,被设置为根据上述修正后的逻辑像素数量计算上述交互对象的转动角度;
转动控制单元,被设置为根据计算获得的上述转动角度,控制上述交互对象进行转动。
可选的,上述控制模块,包括:
距离计算单元,被设置为根据上述修正后的逻辑像素数量计算上述交互对象移动的像素距离;
移动控制单元,被设置为根据计算获得的上述像素距离,控制上述交互对象进行移动。
综上所述,本申请实施例所示的装置,在获取到针对交互对象的触控操作对应的逻辑像素数量后,并不直接根据该触控操作对应的逻辑像素数量对交互对象进行控制,而是先根据触摸屏的逻辑像素密度和基准像素密度对该触控操作对应的逻辑像素数量进行修正,并按照修正后的逻辑像素数量控制交互对象,使得在任意多个触摸屏中进行同样物理距离的滑动控制操作时,无论这些触摸屏的逻辑像素密度是否相同,最终对交互对象的控制效果都保持一致。
此外,本申请实施例所示的装置,在对触控操作对应的逻辑像素数量进行修正时,对触控操作对应逻辑像素数量乘以应用程序界面的当前分辨率与默认分辨率之间的比值,从而消除不同屏幕分辨率对触控操作的操作结果的影响。
本申请实施例还提供了一种包括指令的非临时性计算机可读存储介质,例如包括指令的存储设备,上述指令可由电子设备的处理器执行以完成本申请各个实施例所示的交互对象控制方法。例如,上述非临时性计算机可读存储介质可以是ROM、随机存取存储器(RAM)、CD-ROM、磁带、软盘和光数据存储设备等。
图12是根据一示例性实施例示出的一种电子设备1200的结构示意图。本申请实施例中的电子设备1200可以包括一个或多个如下组成部分:被设置为执行计算机程序指令以完成各种流程和方法的处理器,被设置为信息和存储程序指令随机接入存储器(RAM)和只读存储器(ROM),被设置为存储数据和信息的存储器,I/O设备,界面,天线等。具体来讲:
电子设备1200可以包括射频(Radio Frequency,RF)电路1210、存储器1220、输入单元1230、显示单元1240、传感器1250、音频电路1260、无线保真(wireless fidelity,WiFi)模块1270、处理器1280、电源1282、摄像头1290等部件。本领域技术人员可以理解,图12中示出的电子设备结构并不构成对电子设备的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。
下面结合图12对电子设备1200的各个构成部件进行具体的介绍:
RF电路1210可被设置为收发信息或通话过程中,信号的接收和发送,特别地,将基站的下行信息接收后,给处理器1280处理;另外,将设计上行的数据发送给基站。通常,RF电路包括但不限于天线、至少一个放大器、收发信机、耦合器、低噪声放大器(Low Noise Amplifier,LNA)、双工器等。此外,RF电路1210还可以通过无线通信与网络和其他设备通信。上述无线通信可以使用任一通信标准或协议,包括但不限于全球移动通讯系统(Global System of Mobile communication,GSM)、通用分组无线服务(General Packet Radio Service,GPRS)、码分多址(Code Division Multiple Access,CDMA)、宽带码分多址(Wideband Code Division Multiple Access,WCDMA)、长期演进(Long Term Evolution,LTE)、电子邮件、短消息服务(Short Messaging Service,SMS)等。
存储器1220可被设置为存储软件程序以及模块,处理器1280通过运行存储在存储器1220的软件程序以及模块,从而执行电子设备1200的各种功能应用以及数据处理。存储器1220可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序(比如声音播放功能、图像播放功能等)等;存储数据区可存储根据电子设备1200的使用所创建的数据(比如音频数据、电话本等)等。此外, 存储器1220可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。
输入单元1230可被设置为接收输入的数字或字符信息,以及产生与电子设备1200的用户设置以及功能控制有关的键信号输入。具体地,输入单元1230可包括触控面板1231以及其他输入设备1232。触控面板1231,也称为触摸屏,可收集用户在其上或附近的触摸操作(比如用户使用手指、触笔等任何适合的物体或附件在触控面板1231上或在触控面板1231附近的操作),并根据预先设定的程式驱动相应的连接装置。可选的,触控面板1231可包括触摸检测装置和触摸控制器两个部分。其中,触摸检测装置检测用户的触摸方位,并检测触摸操作带来的信号,将信号传送给触摸控制器;触摸控制器从触摸检测装置上接收触摸信息,并将它转换成触点坐标,再送给处理器1280,并能接收处理器1280发来的命令并加以执行。此外,可以采用电阻式、电容式、红外线以及表面声波等多种类型实现触控面板1231。除了触控面板1231,输入单元1230还可以包括其他输入设备1232。具体地,其他输入设备1232可以包括但不限于物理键盘、功能键(比如音量控制按键、开关按键等)、轨迹球、鼠标、操作杆等中的一种或多种。
显示单元1240可被设置为显示由用户输入的信息或提供给用户的信息以及电子设备1200的各种菜单。显示单元1240可包括显示面板1241,可选的,可以采用液晶显示器(Liquid Crystal Display,LCD)、有机发光二极管(Organic Light-Emitting Diode,OLED)等形式来配置显示面板1241。进一步的,触控面板1231覆盖显示面板1241,当触控面板1231检测到在其上或附近的触摸操作后,传送给处理器1280以确定触摸事件的类型,随后处理器1280根据触摸事件的类型在显示面板1241上提供相应的视觉输出。虽然在图12中,触控面板1231与显示面板1241是作为两个独立的部件来实现电子设备1200的输入和输入功能,但是在某些实施例中,可以将触控面板1231与显示面板1241集成而实现电子设备1200的输入和输出功能。
电子设备1200还可包括至少一种传感器1250,比如陀螺仪传感器、磁感应传感器、光传感器、运动传感器以及其他传感器。具体地,光传感 器可包括环境光传感器及接近传感器,其中,环境光传感器可根据环境光线的明暗来调节显示面板1241的亮度,接近传感器可在电子设备1200移动到耳边时,关闭显示面板1241和/或背光。作为运动传感器的一种,加速度传感器可检测各个方向上(一般为三轴)加速度的大小,静止时可检测出重力的大小及方向,可被设置为识别电子设备姿态的应用(比如横竖屏切换、相关游戏、磁力计姿态校准)、振动识别相关功能(比如计步器、敲击)等;至于电子设备1200还可配置的气压计、湿度计、温度计、红外线传感器等其他传感器,在此不再赘述。
音频电路1260、扬声器1281,传声器1262可提供用户与电子设备1200之间的音频接口。音频电路1260可将接收到的音频数据转换后的电信号,传输到扬声器1261,由扬声器1261转换为声音信号输出;另一方面,传声器1262将收集的声音信号转换为电信号,由音频电路1260接收后转换为音频数据,再将音频数据输出处理器1280处理后,经RF电路1210以发送给比如另一电子设备,或者将音频数据输出至存储器1220以便进一步处理。
WiFi属于短距离无线传输技术,电子设备1200通过WiFi模块1270可以帮助用户收发电子邮件、浏览网页和访问流式媒体等,它为用户提供了无线的宽带互联网访问。虽然图12示出了WiFi模块1270,但是可以理解的是,其并不属于电子设备1200的必须构成,完全可以根据需要在不改变公开的本质的范围内而省略。
处理器1280是电子设备1200的控制中心,利用各种接口和线路连接整个电子设备的各个部分,通过运行或执行存储在存储器1220内的软件程序和/或模块,以及调用存储在存储器1220内的数据,执行电子设备1200的各种功能和处理数据,从而对电子设备进行整体监控。可选的,处理器1280可包括一个或多个处理单元;优选的,处理器1280可集成应用处理器和调制解调处理器,其中,应用处理器主要处理操作系统、用户界面和应用程序等,调制解调处理器主要处理无线通信。可以理解的是,上述调制解调处理器也可以不集成到处理器1280中。
电子设备1200还包括给各个部件供电的电源1282(比如电池),优选的,电源可以通过电源管理系统与处理器1280逻辑相连,从而通过电源 管理系统实现管理充电、放电、以及功耗管理等功能。
摄像头1290一般由镜头、图像传感器、接口、数字信号处理器、CPU、显示屏幕等组成。其中,镜头固定在图像传感器的上方,可以通过手动调节镜头来改变聚焦;图像传感器相当于传统相机的“胶卷”,是摄像头采集图像的心脏;接口被设置为把摄像头利用排线、板对板连接器、弹簧式连接方式与电子设备主板连接,将采集的图像发送给上述存储器1220;数字信号处理器通过数学运算对采集的图像进行处理,将采集的模拟图像转换为数字图像并通过接口发送给存储器1220。
尽管未示出,电子设备1200还可以包括蓝牙模块等,在此不再赘述。
电子设备1200除了包括一个或者多个处理器1280,还包括有存储器,以及一个或者多个模块,其中一个或者多个模块存储于存储器中,并被配置成由一个或者多个处理器执行,以实现上述图3所示方法中的全部或者部分步骤。
本申请旨在涵盖本申请各个实施例的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本申请各个实施例的一般性原理并包括本申请各个实施例未公开的本技术领域中的公知常识或惯用技术手段。说明书和实施例仅被视为示例性的,本申请各个实施例的保护范围由下面的权利要求指出。
应当理解的是,本申请各个实施例并不局限于上面已经描述并在附图中示出的精确结构,并且可以在不脱离其范围进行各种修改和改变。本申请各个实施例的范围由所附的权利要求来限制。
。
Claims (16)
- 一种交互对象控制方法,所述方法包括:终端获取在所述终端的触摸屏中执行的,针对交互对象的触控操作对应的逻辑像素数量;所述终端获取所述触摸屏的逻辑像素密度,所述逻辑像素密度用于指示所述触摸屏中单位面积内包含的逻辑像素数量;所述终端根据所述逻辑像素密度以及基准像素密度对所述触控操作对应的逻辑像素数量进行修正;所述终端根据修正后的逻辑像素数量对所述交互对象进行控制。
- 根据权利要求1所述的方法,其中,所述终端获取所述触摸屏的逻辑像素密度,包括:获取核心组件提供的系统属性读取对象,所述核心组件是对所述交互对象对应的应用程序提供支持的第三方核心组件,所述系统属性读取对象对外提供第一应用程序编程接口API;调用所述第一API获取所述系统属性读取对象返回的所述逻辑像素密度,所述逻辑像素密度是所述系统属性读取对象调用所述终端的操作系统提供的第二API获得的。
- 根据权利要求1所述的方法,其中,当所述触摸屏的逻辑像素密度与所述触摸屏的物理像素密度相同时,所述终端获取所述触摸屏的逻辑像素密度,包括:调用核心组件提供的第三API获取所述物理像素密度,所述核心组件是对所述交互对象对应的应用程序提供支持的第三方核心组件;将获取到的所述物理像素密度确定为所述逻辑像素密度。
- 根据权利要求1所述的方法,其中,所述终端根据所述逻辑像素密度以及基准像素密度对所述触控操作对应的逻辑像素数量进行修正,包括:将所述触控操作对应的逻辑像素数量与所述基准像素密度的乘 积除以所述逻辑像素密度,获得修正后的逻辑像素数量。
- 根据权利要求1所述的方法,其中,所述终端根据所述逻辑像素密度以及基准像素密度对所述触控操作对应的逻辑像素数量进行修正,包括:获取所述交互对象的分辨率缩放因子,所述分辨率缩放因子是所述交互对象对应的应用程序界面的当前分辨率与默认分辨率之间的比值;将所述触控操作对应的逻辑像素数量与所述基准像素密度的乘积除以所述逻辑像素密度后,乘以所述分辨率缩放因子,获得修正后的逻辑像素数量。
- 根据权利要求4或5所述的方法,其中,所述终端根据修正后的逻辑像素数量对所述交互对象进行控制,包括:根据所述修正后的逻辑像素数量计算所述交互对象的转动角度;根据计算获得的所述转动角度,控制所述交互对象进行转动。
- 根据权利要求4或5所述的方法,其中,所述终端根据修正后的逻辑像素数量对所述交互对象进行控制,包括:根据所述修正后的逻辑像素数量计算所述交互对象移动的像素距离;根据计算获得的所述像素距离,控制所述交互对象进行移动。
- 一种交互对象控制装置,包括一个或多个处理器,以及一个或多个存储程序单元的存储器,其中,所述程序单元由所述处理器执行,所述程序单元包括:像素数量获取模块,被设置为获取在终端的触摸屏中执行的,针对交互对象的触控操作对应的逻辑像素数量;像素密度获取模块,被设置为获取所述触摸屏的逻辑像素密度,所述逻辑像素密度用于指示所述触摸屏中单位面积内包含的逻辑像素数量;修正模块,被设置为根据所述逻辑像素密度以及基准像素密度对 所述触控操作对应的逻辑像素数量进行修正;控制模块,被设置为根据修正后的逻辑像素数量对所述交互对象进行控制。
- 根据权利要求8所述的装置,其中,所述像素密度获取模块,包括:对象获取单元,被设置为获取核心组件提供的系统属性读取对象,所述核心组件是对所述交互对象对应的应用程序提供支持的第三方核心组件,所述系统属性读取对象对外提供第一应用程序编程接口API;第一调用单元,被设置为调用所述第一API获取所述系统属性读取对象返回的所述逻辑像素密度,所述逻辑像素密度是所述系统属性读取对象调用所述终端的操作系统提供的第二API获得的。
- 根据权利要求8所述的装置,其中,当所述触摸屏的逻辑像素密度与所述触摸屏的物理像素密度相同时,所述像素密度获取模块,包括:第二调用单元,被设置为调用核心组件提供的第三API获取所述物理像素密度,所述核心组件是对所述交互对象对应的应用程序提供支持的第三方核心组件;确定单元,被设置为将获取到的所述物理像素密度确定为所述逻辑像素密度。
- 根据权利要求8所述的装置,其中,所述修正模块,被设置为将所述触控操作对应的逻辑像素数量与所述基准像素密度的乘积除以所述逻辑像素密度,获得修正后的逻辑像素数量。
- 根据权利要求8所述的装置,其中,所述修正模块,包括:因子获取单元,被设置为获取所述交互对象的分辨率缩放因子,所述分辨率缩放因子是所述交互对象对应的应用程序界面的当前分辨率与默认分辨率之间的比值;修正单元,被设置为将所述触控操作对应的逻辑像素数量与所述基准像素密度的乘积除以所述逻辑像素密度后,乘以所述分辨率缩放因子,获得修正后的逻辑像素数量。
- 根据权利要求11或12所述的装置,其中,所述控制模块,包括:角度计算单元,被设置为根据所述修正后的逻辑像素数量计算所述交互对象的转动角度;转动控制单元,被设置为根据计算获得的所述转动角度,控制所述交互对象进行转动。
- 根据权利要求11或12所述的装置,其中,所述控制模块,包括:距离计算单元,被设置为根据所述修正后的逻辑像素数量计算所述交互对象移动的像素距离;移动控制单元,被设置为根据计算获得的所述像素距离,控制所述交互对象进行移动。
- 一种计算机可读存储介质,其中存储有多条指令,所述指令适于由处理器加载并执行:获取在终端的触摸屏中执行的,针对交互对象的触控操作对应的逻辑像素数量;获取所述触摸屏的逻辑像素密度,所述逻辑像素密度用于指示所述触摸屏中单位面积内包含的逻辑像素数量;根据所述逻辑像素密度以及基准像素密度对所述触控操作对应的逻辑像素数量进行修正;根据修正后的逻辑像素数量对所述交互对象进行控制。
- 一种终端,所述终端包括处理器和存储器,所述存储器中存储有至少一条指令,所述至少一条指令由所述处理器加载并执行以实现如权利要求1至7中任一权利要求所述的交互对象控制方法。
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
US16/773,851 US10963100B2 (en) | 2017-08-08 | 2020-01-27 | Interactive object control method and apparatus, terminal, and computer-readable storage medium |
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710668854.0 | 2017-08-08 | ||
CN201710668854.0A CN107450841B (zh) | 2017-08-08 | 2017-08-08 | 交互对象控制方法及装置 |
Related Child Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
US16/773,851 Continuation US10963100B2 (en) | 2017-08-08 | 2020-01-27 | Interactive object control method and apparatus, terminal, and computer-readable storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2019029379A1 true WO2019029379A1 (zh) | 2019-02-14 |
Family
ID=60490956
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2018/097250 WO2019029379A1 (zh) | 2017-08-08 | 2018-07-26 | 交互对象控制方法、装置、终端及计算机可读存储介质 |
Country Status (3)
Country | Link |
---|---|
US (1) | US10963100B2 (zh) |
CN (1) | CN107450841B (zh) |
WO (1) | WO2019029379A1 (zh) |
Families Citing this family (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107450841B (zh) | 2017-08-08 | 2019-05-07 | 腾讯科技(深圳)有限公司 | 交互对象控制方法及装置 |
CN109656416B (zh) * | 2018-12-28 | 2022-04-15 | 腾讯音乐娱乐科技(深圳)有限公司 | 一种基于多媒体数据的控制方法、装置以及相关设备 |
CN110299123B (zh) * | 2019-07-16 | 2022-06-21 | 广州市迪声音响有限公司 | 音频处理器的自适应分辨率显示方法 |
CN113032060A (zh) * | 2019-12-24 | 2021-06-25 | 腾讯科技(深圳)有限公司 | 视觉元素显示方法、装置及终端 |
CN111583209B (zh) * | 2020-04-29 | 2021-11-02 | 上海杏脉信息科技有限公司 | 一种脑灌注图像特征点选取方法、介质及电子设备 |
CN115605831A (zh) * | 2020-06-03 | 2023-01-13 | 谷歌有限责任公司(Us) | 校正触摸输入 |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2004288048A (ja) * | 2003-03-24 | 2004-10-14 | Ntt Data Corp | ポインティングシステム |
CN104238890A (zh) * | 2014-09-19 | 2014-12-24 | 小米科技有限责任公司 | 文字显示方法及装置 |
US20160077605A1 (en) * | 2014-09-17 | 2016-03-17 | Getac Technology Corporation | Cursor control apparatus and cursor control method thereof |
CN105446496A (zh) * | 2014-08-06 | 2016-03-30 | 神讯电脑(昆山)有限公司 | 光标控制装置及其光标控制方法 |
CN107450841A (zh) * | 2017-08-08 | 2017-12-08 | 腾讯科技(深圳)有限公司 | 交互对象控制方法及装置 |
Family Cites Families (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8539385B2 (en) * | 2010-01-26 | 2013-09-17 | Apple Inc. | Device, method, and graphical user interface for precise positioning of objects |
US8194036B1 (en) * | 2011-06-29 | 2012-06-05 | Google Inc. | Systems and methods for controlling a cursor on a display using a trackpad input device |
CN102662673B (zh) * | 2012-04-09 | 2014-10-15 | 浪新微电子系统(上海)有限公司 | 用于手持设备的人机交互装置 |
JP5331935B1 (ja) * | 2012-12-22 | 2013-10-30 | 淳也 榎本 | 無線による画面表示制御方法及びシステム |
US9489066B2 (en) * | 2013-06-26 | 2016-11-08 | Pixart Imaging Inc. | Computer system including mouse device with adjustable DPI based on screen size and operating method thereof |
JP6255838B2 (ja) * | 2013-09-20 | 2018-01-10 | カシオ計算機株式会社 | 表示装置、表示制御方法及びプログラム |
US9977583B2 (en) * | 2015-03-26 | 2018-05-22 | Eresearchtechnology, Inc. | System, method and apparatus for displaying a non-biasing and self-adjusting visual analog scale on a computing device |
CN106095373B (zh) * | 2016-06-21 | 2019-05-03 | 东软集团股份有限公司 | 实现跨设备屏幕坐标适配、操作设备的方法及对应的装置 |
CN109213413A (zh) * | 2017-07-07 | 2019-01-15 | 阿里巴巴集团控股有限公司 | 一种推荐方法、装置、设备和存储介质 |
-
2017
- 2017-08-08 CN CN201710668854.0A patent/CN107450841B/zh active Active
-
2018
- 2018-07-26 WO PCT/CN2018/097250 patent/WO2019029379A1/zh active Application Filing
-
2020
- 2020-01-27 US US16/773,851 patent/US10963100B2/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2004288048A (ja) * | 2003-03-24 | 2004-10-14 | Ntt Data Corp | ポインティングシステム |
CN105446496A (zh) * | 2014-08-06 | 2016-03-30 | 神讯电脑(昆山)有限公司 | 光标控制装置及其光标控制方法 |
US20160077605A1 (en) * | 2014-09-17 | 2016-03-17 | Getac Technology Corporation | Cursor control apparatus and cursor control method thereof |
CN104238890A (zh) * | 2014-09-19 | 2014-12-24 | 小米科技有限责任公司 | 文字显示方法及装置 |
CN107450841A (zh) * | 2017-08-08 | 2017-12-08 | 腾讯科技(深圳)有限公司 | 交互对象控制方法及装置 |
Also Published As
Publication number | Publication date |
---|---|
US10963100B2 (en) | 2021-03-30 |
CN107450841A (zh) | 2017-12-08 |
CN107450841B (zh) | 2019-05-07 |
US20200159367A1 (en) | 2020-05-21 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2019184889A1 (zh) | 增强现实模型的调整方法、装置、存储介质和电子设备 | |
US10963100B2 (en) | Interactive object control method and apparatus, terminal, and computer-readable storage medium | |
CN109743498B (zh) | 一种拍摄参数调整方法及终端设备 | |
CN108989678B (zh) | 一种图像处理方法、移动终端 | |
CN111142991A (zh) | 一种应用功能页面显示方法及电子设备 | |
WO2019149028A1 (zh) | 应用程序的下载方法及终端 | |
KR20220092937A (ko) | 화면 표시의 제어 방법 및 전자기기 | |
CN110908558A (zh) | 一种图像显示方法及电子设备 | |
CN107741814B (zh) | 一种显示控制方法及移动终端 | |
CN111083386B (zh) | 图像处理方法及电子设备 | |
CN107957841B (zh) | 滚动截屏方法及装置 | |
WO2019137535A1 (zh) | 物距测量方法及终端设备 | |
CN111010523A (zh) | 一种视频录制方法及电子设备 | |
US11805317B2 (en) | Method and electronic device for image processing | |
US9983693B2 (en) | Spatial motion-based user interactivity | |
CN109104573B (zh) | 一种确定对焦点的方法及终端设备 | |
CN108833791B (zh) | 一种拍摄方法和装置 | |
JP7472281B2 (ja) | 電子機器及びフォーカス方法 | |
CN110913133B (zh) | 拍摄方法及电子设备 | |
CN109559280B (zh) | 一种图像处理方法及终端 | |
CN110996003B (zh) | 一种拍照定位方法、装置及移动终端 | |
CN114648498A (zh) | 一种虚像内容度量方法、装置、电子设备和存储介质 | |
CN111427496B (zh) | 参数调整的方法及电子设备 | |
CN111050075B (zh) | 图像处理方法及电子设备 | |
CN110933305B (zh) | 电子设备及对焦方法 |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 18845185 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 18845185 Country of ref document: EP Kind code of ref document: A1 |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 18845185 Country of ref document: EP Kind code of ref document: A1 |