Game text processing method, device, equipment and storage medium
By judging punctuation marks in game text processing and adjusting the length of the display box, the problem of inefficiency in the existing technology is solved, the intelligence and aesthetics of text processing are realized, and the user experience is improved.
Patent Information
- Application Number
- CN202111182198.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-11
- Publication Date
- 2025-09-02
- Estimated Expiration
- 2041-10-11
AI Technical Summary
The existing game text processing methods are inefficient and cannot intuitively adjust the line breaking needs, which leads to multiple configurations and debugging by planning and artists, which are prone to misconfiguration and high communication costs.
By determining whether the first character after the truncation point is a punctuation mark, and adjusting the truncating point when the first character is a punctuation mark, increasing the length of the target text display box to include punctuation marks, ensuring that the punctuation marks do not appear at the beginning of the sentence or paragraph, and adjusting the text display according to the text box configuration information and font configuration information.
It improves the efficiency and intelligence of text processing, reduces the number of configuration and debugging, improves the user experience, and ensures the aesthetics and consistency of text display.
Smart Images

Figure CN113919284B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of text processing technology, and in particular to a game text processing method, device, equipment and storage medium. Background Art
[0002] During the design and production process of a game, there is a need to display text on the corresponding interface within the game. To meet this need, the native text interface provides line wrapping and segmentation functions. However, this function can only achieve automatic line wrapping and cannot be adjusted according to different line wrapping requirements, which cannot meet the needs of planners and artists.
[0003] The existing interface processing method typically requires designers to first configure text in a table, manually segmenting the text during configuration. The game program then reads the configuration data from the table and displays it on the game interface. Because the tools used by designers to configure the table don't provide a direct visual representation of the final in-game display, they must verify the results in-game after each configuration. If the results don't meet expectations, they must return to the table for further adjustments. This process is cumbersome and lacks direct translation to the in-game results. Designers often need to perform multiple configurations and in-game debugging before achieving satisfactory results, which is inefficient and prone to errors. Furthermore, after the design is complete, the design often needs to be approved by the artist before the entire production process can be completed. Problems at any stage in the process lead to rework and communication costs, resulting in low overall production efficiency.
[0004] In summary, how to improve the efficiency of text processing in games while ensuring output effects is a technical problem that currently needs to be solved urgently by those skilled in the art. Summary of the Invention
[0005] In view of this, the purpose of the present invention is to provide a method, device, equipment and medium for processing game text, which can improve the efficiency and intelligence of text processing, thereby enhancing the user experience. The specific scheme is as follows:
[0006] In a first aspect, the present application discloses a method for processing game text, comprising:
[0007] Determine the configuration texts, and read in the configuration texts one by one;
[0008] When the amount of text read in reaches the amount of text in a single line of the target text display box, a truncation point is set, and it is determined whether the first character of the remaining text to be read in after the truncation point is a punctuation mark;
[0009] If the first character is a punctuation mark, read the first character and adjust the truncation point to after the first character;
[0010] Increasing the length of the target text display frame by one unit character width;
[0011] The read text is output to the target text display frame according to the truncation point for display.
[0012] Optionally, before setting the truncation point when the amount of text read in reaches the amount of a single line of text in the target text display box, the method further includes:
[0013] Obtaining text box configuration information of the target text display box;
[0014] A single-line width threshold of the target text display frame is determined according to the text frame configuration information, and the single-line width threshold is used as the single-line text amount.
[0015] Optionally, before setting the truncation point when the amount of text read in reaches the amount of a single line of text in the target text display box, the method further includes:
[0016] Acquire text box configuration information of the target text display box, and font configuration information of the pre-configured configuration text when displayed in the target text display box;
[0017] A single-line character threshold of the target text display frame is determined according to the text frame configuration information and the font configuration information, and the single-line character threshold is used as the single-line text amount.
[0018] Optionally, after increasing the length of the target text display box by one unit character width, the method further includes:
[0019] Determine whether there is any remaining text to be read;
[0020] If there are remaining texts to be read, executing the step of reading the configuration texts one by one;
[0021] If there is no remaining text to be read, the text configuration is completed.
[0022] Optionally, before the text configuration is completed, the following steps are further included:
[0023] If there is no remaining text to be read, determine whether the amount of text in the last line reaches the minimum text threshold;
[0024] If not, the text in the last line is added to the end of the adjacent line for output, and the length of the target text display box is adjusted according to the amount of text in the last line;
[0025] If so, execute the steps to complete the text configuration.
[0026] Optionally, before the text configuration is completed, the following steps are further included:
[0027] If there is no text to be read, determining whether the display widths of the text lines are consistent based on the truncation point;
[0028] If they are inconsistent, the display width of each line of text is adjusted according to the maximum display width;
[0029] If they are consistent, execute the steps to complete the text configuration.
[0030] Optionally, outputting the read text to the target text display frame according to the truncation point for display includes:
[0031] Get text segmentation settings;
[0032] If the text segmentation is set to segment display, the read text is displayed and output as a single line in the target text display frame according to the truncation point;
[0033] If the text segmentation is set to line break display, the read text is displayed and output in multiple lines in the target text display box according to the truncation point.
[0034] In a second aspect, the present application discloses a game text processing device, comprising:
[0035] A text reading module, used to determine the configuration texts and read the configuration texts one by one;
[0036] A truncation point setting module is used to set a truncation point when the amount of text read in reaches the amount of a single line of text in the target text display box, and to determine whether the first character of the remaining text to be read in after the truncation point is a punctuation mark;
[0037] a truncation point adjustment module, configured to read the first character if the first character is a punctuation mark, and adjust the truncation point to after the first character;
[0038] A display frame length adjustment module, configured to increase the length of the target text display frame according to the length of the first character;
[0039] The text output module is used to output the read text to the target text display frame according to the truncation point for display.
[0040] In a third aspect, the present application discloses an electronic device, comprising:
[0041] Memory, used to store computer programs;
[0042] The processor is used to execute the computer program to implement the aforementioned game text processing method.
[0043] In a fourth aspect, the present application discloses a computer-readable storage medium for storing a computer program; wherein the computer program implements the aforementioned game text processing method when executed by a processor.
[0044] In the present application, a configuration text is determined and read in one by one; when the amount of text read in reaches the amount of single-line text in the target text display box, a truncation point is set, and it is determined whether the first character of the remaining text to be read in after the truncation point is a punctuation mark; if the first character is a punctuation mark, the first character is read in, and the truncation point is adjusted to after the first character; the length of the target text display box is increased by one unit character width; and the read text is output to the target text display box according to the truncation point for display. It can be seen that by judging whether the first character of the remaining text to be read after the truncation point is a punctuation mark, and reading the first character when it is a punctuation mark, and then adjusting the above-mentioned truncation point to after the above-mentioned first character, and at the same time increasing the length of the target text display box by one unit character width, and finally outputting the read text before the current truncation point to the target text display box after increasing the width of one unit character for display, it can be achieved that the punctuation mark does not appear in the first position, that is, does not appear at the beginning of a sentence or a paragraph, and by increasing the length of the target text display box by one unit character width, the read text including the last punctuation mark can be completely presented in a line of the text display box, thereby improving the efficiency and intelligence of text processing, and thus improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are merely embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.
[0046] Figure 1 A flowchart of a game text processing method provided by this application;
[0047] Figure 2 A schematic diagram of the structure of a game text processing device provided in this application;
[0048] Figure 3 This is a structural diagram of an electronic device provided in this application. DETAILED DESCRIPTION
[0049] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts shall fall within the scope of protection of the present invention.
[0050] This application embodiment discloses a method for processing game text. Figure 1 As shown, the method may include the following steps:
[0051] Step S11: Determine the configuration texts and read them in one by one.
[0052] Configuration text refers to the text that needs to be displayed on the game interface. In this embodiment, there is no limit on the character type contained in the configuration text, and it can include text, letters, punctuation marks, etc. In addition, there is no limit on the language type (such as font) and display type (such as full-width and half-width) of each character, and the display method is set accordingly according to actual output needs. The main body that reads the configuration text one by one is the game program.
[0053] Step S12: When the amount of text read in reaches the amount of a single line of text in the target text display box, a truncation point is set, and it is determined whether the first character of the remaining text to be read in after the truncation point is a punctuation mark.
[0054] In this embodiment, the amount of text currently being read is determined while the configuration text is being read character by character, i.e., the amount of text already read in this text reading operation. A truncation point is set when the amount of text read reaches the amount of text that can fit in a single line of text in the target text display box, i.e., the truncation point is set at the last character of the text already read. A determination is then made as to whether the first character of the remaining text to be read after the truncation point is a punctuation mark. The above-mentioned amount of text can be the number of characters, the width of the text, or some other measure of the total amount of text, which is not limited in this embodiment, and the amount of text read can be measured based on the needs of the output display.
[0055] In this embodiment, before setting the truncation point when the amount of text read in reaches the amount of single-line text in the target text display box, the method may further include: obtaining the text box configuration information of the target text display box; determining the single-line width threshold of the target text display box based on the text box configuration information, and using the single-line width threshold as the single-line text amount. It is understandable that, based on the text box configuration information of the above-mentioned target text display box, the single-line width threshold of the target text display box is determined, and then the single-line width threshold is used as the single-line text amount of the above-mentioned target text display box. Then, it is possible to judge whether the amount of text read in reaches the single-line text amount of the target text display box based on the character width of the read-in text and the above-mentioned single-line width threshold, that is, in this embodiment, whether the amount of text read in reaches the single-line text amount of the target text display box is judged based on the pixel width of the text.
[0056] In this embodiment, before setting the truncation point when the amount of text read in reaches the amount of single-line text in the target text display box, the method may further include: obtaining the text box configuration information of the target text display box, and the font configuration information of the pre-configured configured text when displayed in the target text display box; determining the single-line character threshold of the target text display box based on the text box configuration information and the font configuration information, and using the single-line character threshold as the amount of single-line text. It is understandable that the single-line character threshold of the target text display box is determined based on the text box configuration information and the font configuration information, and then the single-line character threshold is used as the amount of single-line text, that is, in this embodiment, it is also possible to determine whether the amount of text read in reaches the amount of single-line text in the target text display box based on the number of characters in the text. Among them, the above-mentioned text box configuration information and font configuration information can be customized by the user according to actual test needs, that is, the text can be processed according to a fixed character length or according to the actual display width, so as to easily cover the various needs of planning and art, and arbitrarily deal with complex situations where texts in different languages need to be processed, thereby ensuring the final game text output effect.
[0057] Step S13: If the first character is a punctuation mark, read the first character and adjust the truncation point to after the first character.
[0058] In this embodiment, if the amount of text read in reaches the amount of single-line text in the target text display box, the first character of the remaining text to be read in after the truncation point is set to be a punctuation mark, then the first character is read in, and the above-mentioned truncation point is adjusted to after the first character. In this way, it can be achieved that the punctuation mark does not appear in the first position, that is, it does not appear at the beginning of a sentence or a paragraph. For example, when the dash "——" is truncated in two lines, the first character is judged and the truncation point is adjusted in this embodiment, so that the dash is displayed in one line and does not appear at the beginning of the sentence. For another example, when the first character is a comma or a period, this embodiment reads the comma or period so that the comma or period is displayed in the same line as the current sentence, thereby avoiding the comma or period appearing at the beginning of the sentence.
[0059] Step S14: increasing the length of the target text display frame by a unit character width.
[0060] In this embodiment, while reading the above-mentioned first character, the length of the target text display box is increased by one unit character width, so that the target text display box has sufficient length to display the above-mentioned first character at the same time in one line, even if the read-in text including the last punctuation mark is completely presented in a certain line of the text display box.
[0061] In this embodiment, after increasing the length of the target text display box by one unit character width, the following steps may also be included: determining whether there is any remaining text to be read; if there is any remaining text to be read, executing the step of reading the configuration text one by one; if there is no remaining text to be read, the text configuration is completed. It is understandable that after the segmentation of the truncation point is completed, it is continued to determine whether there is any unread text, that is, whether there is any unread text in the current configuration text. If so, the text reading step is re-executed, that is, the text is re-read and the amount of text read in the new text is counted, and then the first character judgment is performed in the same way to achieve automatic segmentation of the text.
[0062] In this embodiment, before the text configuration is completed, the following steps may also be included: if there is no remaining text to be read, determining whether the amount of text in the last line reaches the minimum text threshold; if not, adding the text in the last line to the end of the adjacent line for output, and adjusting the length of the target text display box according to the amount of text in the last line; if reached, executing the step of completing the text configuration. The above method avoids the situation where the newly generated paragraph has only a small amount of text (such as a single word plus punctuation) by setting the minimum number of words that can be tolerated in the new paragraph after text segmentation (i.e., the minimum text threshold), thereby improving the aesthetics of the text output.
[0063] In this embodiment, before the text configuration is completed, the following steps may be further performed: if there is no text to be read, determining whether the display widths of the lines of text are consistent based on the truncation point; if they are inconsistent, adjusting the display widths of the lines of text based on the maximum display width; if they are consistent, executing the step of completing the text configuration. This ensures that the display widths of the lines of text obtained after text segmentation are consistent, thereby improving the neatness of the segmented text.
[0064] Step S15: outputting the read text to the target text display frame according to the truncation point for display.
[0065] In this embodiment, after the configuration text is read in, the read text is output to the target text display box according to the truncation point for display, that is, the text between the two truncation points is displayed in one line. In this way, it can be achieved that punctuation marks do not appear in the first position, that is, they do not appear at the beginning of a sentence or a paragraph, and by increasing the length of the target text display box by one unit character width, the read text including the last punctuation mark can be completely presented in one line of the text display box, thereby realizing automatic processing of the text. In addition, in the custom planning output of text processing, there is no need to repeatedly modify the configuration text table. The way the text is displayed in the game can be adjusted directly by modifying the single-line text amount of the target text display box, which can effectively improve production efficiency.
[0066] In this embodiment, the text that has been read in is output to the target text display frame according to the cutoff point for display, which may include: obtaining a text segmentation setting; if the text segmentation setting is segmented display, the text that has been read in is output as a single line in the target text display frame according to the cutoff point; if the text segmentation setting is line break display, the text that has been read in is output as multiple lines in the target text display frame according to the cutoff point. Specifically, the display mode can be set according to actual needs, such as being set to segmented display (in a single-line display mode, only one line of text is displayed at a time, and each line of text is output in turn), line break display (in a multi-line display mode, multiple lines of text can be displayed at a time), etc., which is not limited in this embodiment. Thus, after the game program reads in the text data configured by the plan, the text that is too long can be automatically wrapped or segmented according to the text segmentation setting, so as to obtain an output mode that can ultimately meet the planning and art requirements on the interface.
[0067] As can be seen from the above, in this embodiment, the configuration text is determined and read in one by one; when the amount of text read in reaches the amount of single-line text in the target text display box, a truncation point is set, and it is determined whether the first character of the remaining text to be read in after the truncation point is a punctuation mark; if the first character is a punctuation mark, the first character is read in, and the truncation point is adjusted to after the first character; the length of the target text display box is increased by one unit character width; the read text is output to the target text display box according to the truncation point for display. It can be seen that by judging whether the first character of the remaining text to be read after the truncation point is a punctuation mark, and reading the first character when it is a punctuation mark, and then adjusting the above-mentioned truncation point to after the above-mentioned first character, and at the same time increasing the length of the target text display box by one unit character width, and finally outputting the read text before the current truncation point to the target text display box after increasing the width of one unit character for display, it can be achieved that the punctuation mark does not appear in the first position, that is, does not appear at the beginning of a sentence or a paragraph, and by increasing the length of the target text display box by one unit character width, the read text including the last punctuation mark can be completely presented in a line of the text display box, thereby improving the efficiency and intelligence of text processing, and thus improving the user experience.
[0068] Correspondingly, the present application also discloses a game text processing device, see Figure 2 As shown, the device includes:
[0069] The text reading module 11 is used to determine the configuration texts and read the configuration texts one by one;
[0070] A truncation point setting module 12 is used to set a truncation point when the amount of text read in reaches the amount of a single line of text in the target text display box, and to determine whether the first character of the remaining text to be read in after the truncation point is a punctuation mark;
[0071] A truncation point adjustment module 13 is configured to read the first character if the first character is a punctuation mark, and adjust the truncation point to after the first character;
[0072] A display frame length adjustment module 14 is configured to increase the length of the target text display frame according to the length of the first character;
[0073] The text output module 15 is used to output the read text to the target text display frame according to the truncation point for display.
[0074] As can be seen from the above, in this embodiment, the configuration text is determined and read in one by one; when the amount of text read in reaches the amount of single-line text in the target text display box, a truncation point is set, and it is determined whether the first character of the remaining text to be read in after the truncation point is a punctuation mark; if the first character is a punctuation mark, the first character is read in, and the truncation point is adjusted to after the first character; the length of the target text display box is increased by one unit character width; the read text is output to the target text display box according to the truncation point for display. It can be seen that by judging whether the first character of the remaining text to be read after the truncation point is a punctuation mark, and reading the first character when it is a punctuation mark, and then adjusting the above-mentioned truncation point to after the above-mentioned first character, and at the same time increasing the length of the target text display box by one unit character width, and finally outputting the read text before the current truncation point to the target text display box after increasing the width of one unit character for display, it can be achieved that the punctuation mark does not appear in the first position, that is, does not appear at the beginning of a sentence or a paragraph, and by increasing the length of the target text display box by one unit character width, the read text including the last punctuation mark can be completely presented in a line of the text display box, thereby improving the efficiency and intelligence of text processing, and thus improving the user experience.
[0075] In some specific embodiments, the game text processing device may specifically include:
[0076] A text box configuration information acquiring unit, configured to acquire text box configuration information of the target text display box;
[0077] The single-line width threshold determination unit is configured to determine the single-line width threshold of the target text display frame according to the text frame configuration information, and use the single-line width threshold as the single-line text amount.
[0078] In some specific embodiments, the game text processing device may specifically include:
[0079] a font configuration information acquiring unit, configured to acquire text box configuration information of the target text display box, and font configuration information of the pre-configured configuration text when displayed in the target text display box;
[0080] The single-line character threshold determination unit is configured to determine the single-line character threshold of the target text display frame according to the text frame configuration information and the font configuration information, and use the single-line character threshold as the single-line text amount.
[0081] In some specific embodiments, the game text processing device may specifically include:
[0082] The remaining text to be read is judged by the unit, which is used to judge whether there is any remaining text to be read;
[0083] A text reading execution unit, configured to execute the step of reading the configuration texts one by one if there are any remaining texts to be read;
[0084] The text configuration completion unit is used to complete the text configuration if there is no remaining text to be read.
[0085] In some specific embodiments, the game text processing device may specifically include:
[0086] A minimum text threshold determination unit is used to determine whether the amount of text in the last line reaches a minimum text threshold if there is no remaining text to be read;
[0087] a target text display frame adjustment unit, configured to add the text in the last line to the end of the adjacent line for output if the amount of text in the last line does not reach a minimum text threshold, and adjust the length of the target text display frame according to the amount of text in the last line;
[0088] The text configuration completion execution unit is used to execute the text configuration completion step if the amount of text in the last line reaches a minimum text threshold.
[0089] In some specific embodiments, the game text processing device may specifically include:
[0090] a width consistency judgment unit, configured to judge whether the display widths of the text lines are consistent according to the truncation point if there is no text to be read;
[0091] A display width adjustment unit, configured to adjust the display width of each line of text according to the maximum display width if the display widths of the lines of text are inconsistent;
[0092] The text configuration completion execution unit is used to execute the text configuration completion step if the display widths of the text lines are consistent.
[0093] In some specific embodiments, the text output module 15 may specifically include:
[0094] A text segmentation setting acquisition unit, used to acquire text segmentation settings;
[0095] A first output unit is configured to display and output the read text in a single line in the target text display frame according to the truncation point if the text segmentation is set to segmented display;
[0096] The second output unit is configured to display and output the read text in multiple lines in the target text display frame according to the truncation points if the text segmentation is set to line break display.
[0097] Furthermore, the present application also discloses an electronic device, see Figure 3 The contents in the drawings should not be considered as any limitation on the scope of use of the present application.
[0098] Figure 3 This is a schematic diagram of the structure of an electronic device 20 provided in an embodiment of the present application. The electronic device 20 may include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 is used to store a computer program, which is loaded and executed by the processor 21 to implement the relevant steps of the game text processing method disclosed in any of the aforementioned embodiments.
[0099] In this embodiment, the power supply 23 is used to provide operating voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and the external device. The communication protocol it follows is any communication protocol that can be applied to the technical solution of this application and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world. Its specific interface type can be selected according to specific application needs and is not specifically limited here.
[0100] In addition, the memory 22, as a carrier for resource storage, can be a read-only memory, random access memory, disk or CD, etc. The resources stored thereon include an operating system 221, a computer program 222 and data 223 including configuration text, etc. The storage method can be temporary storage or permanent storage.
[0101] The operating system 221 is used to manage and control the hardware devices and computer programs 222 on the electronic device 20, so as to enable the processor 21 to calculate and process the massive amount of data 223 in the memory 22. The operating system 221 can be Windows Server, NetWare, Unix, Linux, etc. In addition to including computer programs capable of implementing the game text processing method disclosed in any of the aforementioned embodiments and executed by the electronic device 20, the computer programs 222 can further include computer programs capable of performing other specific tasks.
[0102] Furthermore, an embodiment of the present application also discloses a computer storage medium, in which computer executable instructions are stored. When the computer executable instructions are loaded and executed by a processor, the game text processing method steps disclosed in any of the aforementioned embodiments are implemented.
[0103] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from the other embodiments. Reference can be made to the descriptions of the identical or similar parts between the various embodiments. For the devices disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the descriptions are relatively simple, and the relevant parts can be referred to the descriptions of the methods.
[0104] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0105] Finally, it should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or device comprising the element.
[0106] The above is a detailed introduction to the game text processing method, device, equipment and medium provided by the present invention. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only intended to help understand the method and core ideas of the present invention. At the same time, for those skilled in the art, based on the ideas of the present invention, there may be changes in the specific implementation methods and application scopes. In summary, the contents of this specification should not be understood as limiting the present invention.
Claims
1. A method for processing game text, characterized in that: include: Determine the configuration texts, and read in the configuration texts one by one; When the amount of text read in reaches the single-line text size of the target text display frame, a truncation point is set, and a determination is made as to whether the first character of the remaining text to be read in after the truncation point is a punctuation mark; the single-line text size is a single-line character threshold determined based on the target text display frame and font configuration information; If the first character is a punctuation mark, read the first character and adjust the truncation point to after the first character; Increasing the length of the target text display frame by one unit character width; The read text is output to the target text display frame according to the truncation point for display.
2. The game text processing method according to claim 1, characterized in that: Before setting the truncation point when the amount of text read in reaches the amount of single-line text in the target text display box, the method further includes: Obtaining text box configuration information of the target text display box; A single-line width threshold of the target text display frame is determined according to the text frame configuration information, and the single-line width threshold is used as the single-line text amount.
3. The game text processing method according to claim 1, characterized in that: Before setting the truncation point when the amount of text read in reaches the amount of single-line text in the target text display box, the method further includes: Acquire text box configuration information of the target text display box, and font configuration information of the pre-configured configuration text when displayed in the target text display box; A single-line character threshold of the target text display frame is determined according to the text frame configuration information and the font configuration information, and the single-line character threshold is used as the single-line text amount.
4. The game text processing method according to claim 1, characterized in that: After increasing the length of the target text display frame by a unit character width, the method further includes: Determine whether there is any remaining text to be read; If there are remaining texts to be read, executing the step of reading the configuration texts one by one; If there is no remaining text to be read, the text configuration is completed.
5. The game text processing method according to claim 4, characterized in that: Before the text configuration is completed, it also includes: If there is no remaining text to be read, determine whether the amount of text in the last line reaches the minimum text threshold; If not, the text in the last line is added to the end of the adjacent line for output, and the length of the target text display box is adjusted according to the amount of text in the last line; If so, execute the steps to complete the text configuration.
6. The game text processing method according to claim 4, characterized in that: Before the text configuration is completed, it also includes: If there is no text to be read, determining whether the display widths of the text lines are consistent based on the truncation point; If they are inconsistent, the display width of each line of text is adjusted according to the maximum display width; If they are consistent, execute the steps to complete the text configuration.
7. The game text processing method according to any one of claims 1 to 6, characterized in that: Outputting the read text to the target text display frame according to the truncation point for display includes: Get text segmentation settings; If the text segmentation is set to segment display, the read text is displayed and output as a single line in the target text display frame according to the truncation point; If the text segmentation is set to line break display, the read text is displayed and output in multiple lines in the target text display box according to the truncation point.
8. A game text processing device, characterized in that: include: A text reading module, used to determine the configuration texts and read the configuration texts one by one; a truncation point setting module, configured to set a truncation point when the amount of text read in reaches the single-line text size of the target text display frame, and determine whether the first character of the remaining text to be read in after the truncation point is a punctuation mark; the single-line text size is a single-line character threshold determined based on the target text display frame and font configuration information; a truncation point adjustment module, configured to read the first character if the first character is a punctuation mark, and adjust the truncation point to after the first character; A display frame length adjustment module, configured to increase the length of the target text display frame according to the length of the first character; The text output module is used to output the read text to the target text display frame according to the truncation point for display.
9. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor, configured to execute the computer program to implement the game text processing method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that Used to store computer programs; wherein when the computer program is executed by a processor, the game text processing method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Text processing method and mobile terminal
US20150331837A1